Skip to content

Commit cfe88a2

Browse files
authored
Merge pull request #1324 from kleros/feat(web)/locked-pnk-redesigns-frontend
feat(web): new lockedstake design implementation
2 parents 347cbcd + 20b2191 commit cfe88a2

File tree

16 files changed

+144
-353
lines changed

16 files changed

+144
-353
lines changed

web/src/components/CasesDisplay/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Divider = styled.hr`
1313
`;
1414

1515
const StyledTitle = styled.h1`
16-
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
16+
margin-bottom: calc(32px + (48 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875) !important;
1717
`;
1818

1919
interface ICasesDisplay extends ICasesGrid {

web/src/components/Field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const FieldContainer = styled.div<FieldContainerProps>`
1818
svg {
1919
fill: ${({ theme }) => theme.secondaryPurple};
2020
margin-right: 8px;
21-
width: 15px;
21+
width: 14px;
2222
}
2323
2424
.link {

web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useAccount } from "wagmi";
77
import { isUndefined } from "utils/index";
88
import Field from "components/Field";
99
import DiceIcon from "svgs/icons/dice.svg";
10-
import LockerIcon from "svgs/icons/locker.svg";
1110
import PNKIcon from "svgs/icons/pnk.svg";
1211
import { useCourtDetails } from "queries/useCourtDetails";
1312
import { useKlerosCoreGetJurorBalance } from "hooks/contracts/generated";
@@ -101,14 +100,9 @@ const JurorBalanceDisplay = () => {
101100
name: "My Stake",
102101
value: `${format(jurorBalance?.[2])} PNK`,
103102
},
104-
{
105-
icon: LockerIcon,
106-
name: "Locked Stake",
107-
value: `${format(jurorBalance?.[1])} PNK`,
108-
},
109103
{
110104
icon: DiceIcon,
111-
name: "Juror odds",
105+
name: "Juror Odds",
112106
value: jurorOdds,
113107
},
114108
];

web/src/pages/Dashboard/Courts/CourtCard/CourtBranch.tsx renamed to web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const Container = styled.div`
99
1010
small {
1111
height: 100%;
12+
font-weight: 600;
1213
}
1314
1415
${landscapeStyle(
@@ -25,15 +26,15 @@ const StyledBreadcrumb = styled(Breadcrumb)`
2526
height: 100%;
2627
`;
2728

28-
interface ICourtBranch {
29+
interface ICourtName {
2930
name: string;
3031
}
3132

32-
const CourtBranch: React.FC<ICourtBranch> = ({ name }) => {
33+
const CourtName: React.FC<ICourtName> = ({ name }) => {
3334
return (
3435
<Container>
3536
<StyledBreadcrumb items={[{ text: name, value: 0 }]} />
3637
</Container>
3738
);
3839
};
39-
export default CourtBranch;
40+
export default CourtName;

web/src/pages/Dashboard/Courts/CourtCard/DesktopCard.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

web/src/pages/Dashboard/Courts/CourtCard/LockedStake.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

web/src/pages/Dashboard/Courts/CourtCard/MobileCard.tsx

Lines changed: 0 additions & 79 deletions
This file was deleted.

web/src/pages/Dashboard/Courts/CourtCard/Stake.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,42 @@ import styled, { css } from "styled-components";
33
import { landscapeStyle } from "styles/landscapeStyle";
44
import { formatUnits } from "viem";
55

6-
const StyledLabel = styled.label`
6+
const Container = styled.div`
77
display: flex;
8-
font-weight: 600;
9-
color: ${({ theme }) => theme.primaryText};
10-
font-size: 16px;
8+
flex-direction: row;
9+
gap: 16px;
10+
justify-content: space-between;
11+
width: 100%;
1112
1213
${landscapeStyle(
1314
() => css`
1415
justify-content: flex-end;
16+
width: auto;
1517
`
1618
)}
1719
`;
1820

21+
const StyledLabel = styled.label`
22+
display: flex;
23+
font-weight: 600;
24+
color: ${({ theme }) => theme.primaryText};
25+
font-size: 16px;
26+
align-items: center;
27+
gap: 32px;
28+
`;
29+
1930
interface IStake {
20-
stake: bigint;
31+
stake: string;
2132
}
2233

2334
const Stake: React.FC<IStake> = ({ stake }) => {
2435
const formattedStake = formatUnits(stake, 18);
2536

26-
return <StyledLabel>{`${formattedStake} PNK`}</StyledLabel>;
37+
return (
38+
<Container>
39+
<label>Stake</label>
40+
<StyledLabel>{`${formattedStake} PNK`}</StyledLabel>
41+
</Container>
42+
);
2743
};
2844
export default Stake;

web/src/pages/Dashboard/Courts/CourtCard/index.tsx

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
11
import React from "react";
2-
import DesktopCard from "./DesktopCard";
3-
import MobileCard from "./MobileCard";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
4+
import { Card as _Card } from "@kleros/ui-components-library";
5+
import CourtName from "./CourtName";
6+
import Stake from "./Stake";
7+
8+
const Container = styled(_Card)`
9+
display: flex;
10+
flex-direction: row;
11+
align-items: center;
12+
justify-content: space-between;
13+
height: auto;
14+
width: 100%;
15+
padding: 21px 24px 25px 19px;
16+
border-left: 5px solid ${({ theme }) => theme.secondaryPurple};
17+
flex-wrap: wrap;
18+
gap: 12px;
19+
20+
${({ theme }) => (theme.name === "light" ? `box-shadow: 0px 2px 3px 0px ${theme.stroke};` : "")}
21+
22+
${landscapeStyle(
23+
() =>
24+
css`
25+
padding: 21.5px 32px 21.5px 27px;
26+
`
27+
)}
28+
`;
429

530
interface ICourtCard {
631
name: string;
7-
stake: bigint;
8-
lockedStake: bigint;
32+
stake: string;
933
}
1034

11-
const CourtCard: React.FC<ICourtCard> = ({ name, stake, lockedStake }) => {
12-
const allProps = { name, stake, lockedStake };
13-
35+
const CourtCard: React.FC<ICourtCard> = ({ name, stake }) => {
1436
return (
15-
<>
16-
<DesktopCard {...allProps} />
17-
<MobileCard {...allProps} />
18-
</>
37+
<Container>
38+
<CourtName name={name} />
39+
<Stake stake={stake} />
40+
</Container>
1941
);
2042
};
2143

0 commit comments

Comments
 (0)