11import React from "react" ;
2- import styled from "styled-components" ;
2+ import styled , { css } from "styled-components" ;
3+ import { landscapeStyle } from "styles/landscapeStyle" ;
34import { IdenticonOrAvatar , AddressOrName } from "components/ConnectWallet/AccountDisplay" ;
45import EthIcon from "assets/svgs/icons/eth.svg" ;
56import PnkIcon from "assets/svgs/icons/kleros.svg" ;
67import PixelArt from "pages/Dashboard/JurorInfo/PixelArt" ;
78import { getUserLevelData } from "utils/userLevelCalculation" ;
89import { useUserQuery } from "hooks/queries/useUser" ;
910
10- const Container = styled . div `
11+ const Container = styled . div < { id ?: number } > `
1112 display: flex;
1213 justify-content: space-between;
14+ flex-wrap: wrap;
1315 width: 100%;
1416 height: 100%;
1517 background-color: ${ ( { theme } ) => theme . whiteBackground } ;
16- padding: 19.5px 32px ;
18+ padding: 24px ;
1719 border 1px solid ${ ( { theme } ) => theme . stroke } ;
18- border-top: none;
20+ border-top: ${ ( { id } ) => ( id === 1 ? "" : " none" ) } ;
1921 align-items: center;
2022
2123 label {
2224 font-size: 16px;
2325 }
24- ` ;
2526
26- const JurorTitle = styled . div `
27- display: flex;
28- gap: 36px;
29- align-items: center;
30- width: 372px;
27+ ${ landscapeStyle (
28+ ( ) => css `
29+ gap: 0px;
30+ padding: 15.55px 32px;
31+ flex-wrap: nowrap;
32+ `
33+ ) }
3134` ;
3235
3336const LogoAndAddress = styled . div `
@@ -42,17 +45,32 @@ const LogoAndAddress = styled.div`
4245 }
4346` ;
4447
45- const JurorData = styled . div `
48+ const TitleAndRewardsAndCoherency = styled . div `
4649 display: flex;
47- justify-content: space-between;
48- width: 100%;
49- flex-wrap: wrap;
50- gap: calc(24px + (48 - 24) * ((100vw - 300px) / (1250 - 300)));
50+ flex-direction: column;
51+ gap: 16px;
52+
53+ ${ landscapeStyle (
54+ ( ) =>
55+ css `
56+ flex-direction: row;
57+ gap: 32px;
58+ `
59+ ) }
5160` ;
5261
53- const RewardsAndCoherency = styled . div `
62+ const JurorTitle = styled . div `
5463 display: flex;
55- gap: calc(52px + (104 - 52) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
64+ gap: 16px;
65+ align-items: center;
66+ justify-content: flex-start;
67+
68+ ${ landscapeStyle (
69+ ( ) => css `
70+ width: calc(140px + (260 - 140) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
71+ gap: 36px;
72+ `
73+ ) }
5674` ;
5775
5876const Rewards = styled . div `
@@ -63,13 +81,23 @@ const Rewards = styled.div`
6381 font-weight: 600;
6482 }
6583 width: 132px;
84+ flex-wrap: wrap;
85+
86+ ${ landscapeStyle (
87+ ( ) =>
88+ css `
89+ width: calc(80px + (180 - 80) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
90+ `
91+ ) }
6692` ;
6793
6894const Coherency = styled . div `
95+ display: flex;
6996 align-items: center;
7097 label {
7198 font-weight: 600;
7299 }
100+ flex-wrap: wrap;
73101` ;
74102
75103const StyledIcon = styled . div `
@@ -108,32 +136,30 @@ const JurorCard: React.FC<IJurorCard> = ({ id, address }) => {
108136 } ;
109137
110138 return (
111- < Container >
112- < JurorTitle >
113- < label > { id } </ label >
114- < LogoAndAddress >
115- < StyledIdenticonOrAvatar address = { address } />
116- < AddressOrName address = { address } />
117- </ LogoAndAddress >
118- </ JurorTitle >
119- < JurorData >
120- < RewardsAndCoherency >
121- < Rewards >
122- < label > { ethReward } </ label >
123- < StyledIcon as = { EthIcon } />
124- < label > +</ label >
125- < label > { pnkReward } </ label >
126- < StyledIcon as = { PnkIcon } />
127- </ Rewards >
128- < Coherency >
129- < label > { coherentVotes } </ label >
130- </ Coherency >
131- </ RewardsAndCoherency >
132- < HowItWorks >
133- < label > Level { userLevelData . level } </ label >
134- < PixelArt width = "32" height = "32" level = { userLevelData . level } />
135- </ HowItWorks >
136- </ JurorData >
139+ < Container id = { id } >
140+ < TitleAndRewardsAndCoherency >
141+ < JurorTitle >
142+ < label > { id } </ label >
143+ < LogoAndAddress >
144+ < StyledIdenticonOrAvatar address = { address } />
145+ < AddressOrName address = { address } />
146+ </ LogoAndAddress >
147+ </ JurorTitle >
148+ < Rewards >
149+ < label > { ethReward } </ label >
150+ < StyledIcon as = { EthIcon } />
151+ < label > +</ label >
152+ < label > { pnkReward } </ label >
153+ < StyledIcon as = { PnkIcon } />
154+ </ Rewards >
155+ < Coherency >
156+ < label > { coherentVotes } </ label >
157+ </ Coherency >
158+ </ TitleAndRewardsAndCoherency >
159+ < HowItWorks >
160+ < label > Level { userLevelData . level } </ label >
161+ < PixelArt width = "32" height = "32" level = { userLevelData . level } />
162+ </ HowItWorks >
137163 </ Container >
138164 ) ;
139165} ;
0 commit comments