Skip to content

Commit 7143771

Browse files
committed
feat(web): fix voting history and update ui-components-library
1 parent b684e93 commit 7143771

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
},
6161
"dependencies": {
6262
"@kleros/kleros-v2-contracts": "workspace:^",
63-
"@kleros/ui-components-library": "^1.9.2",
63+
"@kleros/ui-components-library": "^2.5.2",
6464
"@sentry/react": "^7.55.2",
6565
"@sentry/tracing": "^7.55.2",
6666
"@types/react-modal": "^3.16.0",

web/src/pages/Cases/CaseDetails/Voting/VotingHistory.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,18 @@ const StyledBox = styled(Box)`
3535
const StyledAccordion = styled(Accordion)`
3636
width: 100%;
3737
> * > button {
38+
justify-content: unset;
39+
padding: 11.5px 18px;
3840
background-color: ${({ theme }) => theme.whiteBackground} !important;
3941
border: 1px solid ${({ theme }) => theme.stroke} !important;
42+
> p {
43+
margin-left: 12px;
44+
margin-right: auto;
45+
color: ${({ theme }) => theme.primaryText};
46+
}
47+
> svg {
48+
fill: ${({ theme }) => theme.primaryText} !important;
49+
}
4050
}
4151
> * > div > div {
4252
padding: 8px 16px;
@@ -75,7 +85,7 @@ const JustificationContainer = styled.div`
7585
}
7686
`;
7787

78-
const VotingHistory: React.FC<{ arbitrable?: string }> = ({ arbitrable }) => {
88+
const VotingHistory: React.FC<{ arbitrable?: `0x${string}` }> = ({ arbitrable }) => {
7989
const { id } = useParams();
8090
const { data: votingHistory } = useVotingHistory(id);
8191
const [currentTab, setCurrentTab] = useState(0);
@@ -108,7 +118,7 @@ const VotingHistory: React.FC<{ arbitrable?: string }> = ({ arbitrable }) => {
108118
items={
109119
localRounds.at(currentTab)?.votes.map((vote) => ({
110120
title: shortenAddress(vote.juror.id),
111-
Icon: <Jazzicon diameter={24} seed={jsNumberForAddress(vote.juror.id)} />,
121+
icon: <Jazzicon diameter={20} seed={jsNumberForAddress(vote.juror.id)} />,
112122
body: (
113123
<AccordionContent
114124
choice={vote.choice === 0 ? "Refuse to arbitrate" : disputeTemplate.answers[vote.choice - 1].title}

web/src/styles/themes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import { lightTheme as componentsLightTheme, darkTheme as componentsDarkTheme } from "@kleros/ui-components-library";
2+
13
export const lightTheme = {
4+
...componentsLightTheme,
25
primaryPurple: "#4D00B4",
36
secondaryPurple: "#9013FE",
47
mediumPurple: "#F8F1FF",
@@ -34,6 +37,7 @@ export const lightTheme = {
3437
};
3538

3639
export const darkTheme = {
40+
...componentsDarkTheme,
3741
primaryPurple: "#7E1BD4",
3842
secondaryPurple: "#B45FFF",
3943
mediumPurple: "#390F6C",

yarn.lock

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,7 +4042,7 @@ __metadata:
40424042
"@kleros/kleros-v2-eslint-config": "workspace:^"
40434043
"@kleros/kleros-v2-prettier-config": "workspace:^"
40444044
"@kleros/kleros-v2-tsconfig": "workspace:^"
4045-
"@kleros/ui-components-library": ^1.9.2
4045+
"@kleros/ui-components-library": ^2.5.2
40464046
"@netlify/functions": ^1.6.0
40474047
"@parcel/transformer-svg-react": ~2.8.0
40484048
"@parcel/watcher": ~2.1.0
@@ -4094,9 +4094,9 @@ __metadata:
40944094
languageName: unknown
40954095
linkType: soft
40964096

4097-
"@kleros/ui-components-library@npm:^1.9.2":
4098-
version: 1.9.2
4099-
resolution: "@kleros/ui-components-library@npm:1.9.2"
4097+
"@kleros/ui-components-library@npm:^2.5.2":
4098+
version: 2.5.2
4099+
resolution: "@kleros/ui-components-library@npm:2.5.2"
41004100
dependencies:
41014101
"@datepicker-react/hooks": ^2.8.4
41024102
"@swc/helpers": ^0.3.2
@@ -4107,12 +4107,13 @@ __metadata:
41074107
simplebar: ^5.3.6
41084108
simplebar-react: ^2.3.6
41094109
smooth-scroll-into-view-if-needed: ^1.1.33
4110+
usehooks-ts: ^2.9.1
41104111
peerDependencies:
41114112
react: ^18.0.0
41124113
react-dom: ^18.0.0
41134114
react-is: ^18.0.0
41144115
styled-components: ^5.3.3
4115-
checksum: 42dfddf1bf2e09be7f9350c173b371b29fdf22b25fb56c6500685d33bc63369ef316c05f0a8b7e81217abbab82557f8300de45357c6ec0d388882ca9d9c3c849
4116+
checksum: 159a999c4e13fb288f1594a677f325002552a06cf3c01e5139a16e2749a795934c3876e7e62eb0401ebeec85dec3ae9c66d9a14ff83de8134c58b0eadbbe6883
41164117
languageName: node
41174118
linkType: hard
41184119

@@ -28259,6 +28260,16 @@ __metadata:
2825928260
languageName: node
2826028261
linkType: hard
2826128262

28263+
"usehooks-ts@npm:^2.9.1":
28264+
version: 2.9.1
28265+
resolution: "usehooks-ts@npm:2.9.1"
28266+
peerDependencies:
28267+
react: ^16.8.0 || ^17.0.0 || ^18.0.0
28268+
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
28269+
checksum: 36f1e4142ce23bc019b81d2e93aefd7f2c350abcf255598c21627114a69a2f2f116b35dc3a353375f09c6e4c9b704a04f104e3d10e98280545c097feca66c30a
28270+
languageName: node
28271+
linkType: hard
28272+
2826228273
"utf-8-validate@npm:^5.0.2":
2826328274
version: 5.0.10
2826428275
resolution: "utf-8-validate@npm:5.0.10"

0 commit comments

Comments
 (0)