11import React from "react" ;
2- import styled from "styled-components" ;
2+ import styled , { css } from "styled-components" ;
3+ import { landscapeStyle } from "styles/landscapeStyle" ;
34import { useAccount } from "wagmi" ;
45import { formatUnits } from "viem" ;
56import { Card as _Card , Breadcrumb } from "@kleros/ui-components-library" ;
6- import WithHelpTooltip from "../WithHelpTooltip" ;
77import { isUndefined } from "utils/index" ;
88import { useKlerosCoreGetJurorBalance } from "hooks/contracts/generated" ;
99
1010const Card = styled ( _Card ) `
11+ display: flex;
12+ flex-direction: row;
13+ align-items: center;
14+ justify-content: space-between;
1115 height: auto;
1216 width: 100%;
13- padding: 12px 24px ;
17+ padding: 21.5px 32px 21.5px 27px ;
1418 border-left: 5px solid ${ ( { theme } ) => theme . secondaryPurple } ;
19+ flex-wrap: wrap;
1520` ;
1621
17- const ValueContainer = styled . div `
18- width: 100%;
22+ const CourtName = styled . div `
23+ small {
24+ height: 100%;
25+ }
26+
27+ ${ landscapeStyle ( ( ) => css `` ) }
28+ ` ;
29+
30+ const StyledBreadcrumb = styled ( Breadcrumb ) `
1931 display: flex;
2032 align-items: center;
21- justify-content: space-between ;
33+ height: 100% ;
2234` ;
2335
24- const StyledBreadcrumb = styled ( Breadcrumb ) `
25- margin-bottom: 12px;
36+ const StakesContainer = styled . div `
37+ display: flex;
38+ flex-direction: row;
39+ align-items: center;
40+
41+ ${ landscapeStyle ( ( ) => css `` ) }
2642` ;
2743
28- const tooltipMsg =
29- "When a juror is selected to arbitrate a case, part of their stake (PNK) is " +
30- "locked until the case is resolved. Jurors whose vote is coherent with the " +
31- "final jury decision have their locked stake released. Jurors whose vote " +
32- "is not coherent with the final jury decision, lose their locked stake. " +
33- "The locked stake of incoherent jurors is redistributed as incentives for " +
34- "the coherent jurors." ;
44+ const Stake = styled . div `
45+ display: flex;
46+ width: 69px;
47+ label {
48+ font-weight: 600;
49+ color: ${ ( { theme } ) => theme . primaryText } ;
50+ }
51+ ` ;
52+
53+ const LockedStake = styled . div `
54+ display: flex;
55+ gap: 8px;
56+ width: 112px;
57+ justify-content: flex-end;
58+ align-items: flex-end;
59+
60+ label {
61+ color: ${ ( { theme } ) => theme . primaryText } ;
62+ }
63+ ` ;
3564
3665interface ICourtCard {
3766 id : string ;
@@ -53,17 +82,17 @@ const CourtCard: React.FC<ICourtCard> = ({ id, name }) => {
5382
5483 return stake > 0 || lockedStake > 0 ? (
5584 < Card >
56- < StyledBreadcrumb items = { [ { text : name , value : 0 } ] } / >
57- < ValueContainer >
58- < label > Stake: </ label >
59- < small > { ` ${ formatedStake } PNK` } </ small >
60- </ ValueContainer >
61- < ValueContainer >
62- < WithHelpTooltip { ... { place : "bottom" , tooltipMsg } } >
63- < label > Locked Stake: </ label >
64- </ WithHelpTooltip >
65- < small > { ` ${ formatedLockedStake } PNK` } </ small >
66- </ ValueContainer >
85+ < CourtName >
86+ < StyledBreadcrumb items = { [ { text : name , value : 0 } ] } / >
87+ </ CourtName >
88+ < StakesContainer >
89+ < Stake >
90+ < label > { ` ${ formatedStake } PNK` } </ label >
91+ </ Stake >
92+ < LockedStake >
93+ < label > { ` ${ formatedLockedStake } PNK` } </ label >
94+ </ LockedStake >
95+ </ StakesContainer >
6796 </ Card >
6897 ) : null ;
6998} ;
0 commit comments