Skip to content

Commit 968d173

Browse files
committed
feat(web): slighly different style for mobile
1 parent eb442de commit 968d173

File tree

2 files changed

+60
-14
lines changed

2 files changed

+60
-14
lines changed

web/src/pages/Home/TopJurors/JurorCard.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ const LogoAndAddress = styled.div`
4545
}
4646
`;
4747

48-
const TitleAndRewardsAndCoherency = styled.div`
48+
const PlaceAndTitleAndRewardsAndCoherency = styled.div`
4949
display: flex;
5050
flex-direction: column;
51-
gap: 16px;
51+
gap: 12px;
5252
5353
${landscapeStyle(
5454
() =>
@@ -59,6 +59,24 @@ const TitleAndRewardsAndCoherency = styled.div`
5959
)}
6060
`;
6161

62+
const JurorPlace = styled.div`
63+
width: 100%;
64+
65+
label::before {
66+
content: "#";
67+
display: inline;
68+
}
69+
70+
${landscapeStyle(
71+
() => css`
72+
width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
73+
label::before {
74+
display: none;
75+
}
76+
`
77+
)}
78+
`;
79+
6280
const JurorTitle = styled.div`
6381
display: flex;
6482
gap: 16px;
@@ -67,7 +85,7 @@ const JurorTitle = styled.div`
6785
6886
${landscapeStyle(
6987
() => css`
70-
width: calc(140px + (260 - 140) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
88+
width: calc(40px + (232 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
7189
gap: 36px;
7290
`
7391
)}
@@ -86,7 +104,7 @@ const Rewards = styled.div`
86104
${landscapeStyle(
87105
() =>
88106
css`
89-
width: calc(80px + (180 - 80) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
107+
width: calc(60px + (180 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
90108
`
91109
)}
92110
`;
@@ -137,9 +155,11 @@ const JurorCard: React.FC<IJurorCard> = ({ id, address }) => {
137155

138156
return (
139157
<Container id={id}>
140-
<TitleAndRewardsAndCoherency>
141-
<JurorTitle>
158+
<PlaceAndTitleAndRewardsAndCoherency>
159+
<JurorPlace>
142160
<label>{id}</label>
161+
</JurorPlace>
162+
<JurorTitle>
143163
<LogoAndAddress>
144164
<StyledIdenticonOrAvatar address={address} />
145165
<AddressOrName address={address} />
@@ -155,7 +175,7 @@ const JurorCard: React.FC<IJurorCard> = ({ id, address }) => {
155175
<Coherency>
156176
<label>{coherentVotes}</label>
157177
</Coherency>
158-
</TitleAndRewardsAndCoherency>
178+
</PlaceAndTitleAndRewardsAndCoherency>
159179
<HowItWorks>
160180
<label> Level {userLevelData.level}</label>
161181
<PixelArt width="32" height="32" level={userLevelData.level} />

web/src/pages/Home/TopJurors/TopJurorsHeader.tsx

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ const Container = styled.div`
2727
)}
2828
`;
2929

30-
const TitleAndRewardsAndCoherency = styled.div`
30+
const PlaceAndTitleAndRewardsAndCoherency = styled.div`
3131
display: flex;
3232
flex-direction: column;
33-
gap: 12px;
33+
gap: 8px;
3434
3535
${landscapeStyle(
3636
() =>
@@ -41,6 +41,30 @@ const TitleAndRewardsAndCoherency = styled.div`
4141
)}
4242
`;
4343

44+
const JurorPlace = styled.div`
45+
width: 100%;
46+
47+
label {
48+
&::before {
49+
content: "# Rank";
50+
visibility: visible;
51+
}
52+
}
53+
54+
${landscapeStyle(
55+
() =>
56+
css`
57+
width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
58+
59+
label {
60+
&::before {
61+
content: "#";
62+
}
63+
}
64+
`
65+
)}
66+
`;
67+
4468
const JurorTitle = styled.div`
4569
display: flex;
4670
gap: 16px;
@@ -56,7 +80,7 @@ const JurorTitle = styled.div`
5680
${landscapeStyle(
5781
() =>
5882
css`
59-
width: calc(160px + (260 - 160) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
83+
width: calc(40px + (232 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
6084
gap: 36px;
6185
`
6286
)}
@@ -66,7 +90,7 @@ const Rewards = styled.div`
6690
${landscapeStyle(
6791
() =>
6892
css`
69-
width: calc(80px + (180 - 80) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
93+
width: calc(60px + (180 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
7094
`
7195
)}
7296
`;
@@ -104,9 +128,11 @@ const coherentVotesTooltipMsg =
104128
const TopJurorsHeader: React.FC = () => {
105129
return (
106130
<Container>
107-
<TitleAndRewardsAndCoherency>
131+
<PlaceAndTitleAndRewardsAndCoherency>
132+
<JurorPlace>
133+
<label></label>
134+
</JurorPlace>
108135
<JurorTitle>
109-
<label>#</label>
110136
<label>Juror</label>
111137
</JurorTitle>
112138
<Rewards>
@@ -119,7 +145,7 @@ const TopJurorsHeader: React.FC = () => {
119145
<label> Coherent Votes </label>
120146
</WithHelpTooltip>
121147
</Coherency>
122-
</TitleAndRewardsAndCoherency>
148+
</PlaceAndTitleAndRewardsAndCoherency>
123149
<HowItWorks>
124150
<BookOpenIcon />
125151
<label> How it works </label>

0 commit comments

Comments
 (0)