Skip to content

Commit 60cb52c

Browse files
committed
feat(web): ruling-and-rewards-indicators
1 parent cc4ccc5 commit 60cb52c

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

web/src/hooks/queries/useVotingHistory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ const votingHistoryQuery = graphql(`
1212
dispute(id: $disputeID) {
1313
id
1414
createdAt
15+
ruled
1516
rounds {
1617
nbVotes
18+
jurorRewardsDispersed
1719
court {
1820
id
1921
name
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
4+
import CheckCircle from "svgs/icons/check-circle-outline.svg";
5+
import Coins from "svgs/icons/pile-coins.svg";
6+
7+
import Label from "components/DisputeView/CardLabels/Label";
8+
9+
const Container = styled.div`
10+
display: flex;
11+
gap: 8px;
12+
flex-wrap: wrap;
13+
`;
14+
15+
interface IRulingAndRewardsIndicators {
16+
jurorRewardsDispersed: boolean;
17+
ruled: boolean;
18+
}
19+
20+
const RulingAndRewardsIndicators: React.FC<IRulingAndRewardsIndicators> = ({ jurorRewardsDispersed, ruled }) => (
21+
<Container>
22+
{ruled ? <Label icon={CheckCircle} text="Ruling executed" color="green" /> : null}
23+
{jurorRewardsDispersed ? <Label icon={Coins} text="Juror rewards distributed" color="green" /> : null}
24+
</Container>
25+
);
26+
27+
export default RulingAndRewardsIndicators;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ import HowItWorks from "components/HowItWorks";
2222
import BinaryVoting from "components/Popup/MiniGuides/BinaryVoting";
2323

2424
import PendingVotesBox from "./PendingVotesBox";
25+
import RulingAndRewardsIndicators from "./RulingAndRewardsIndicators";
2526
import VotesAccordion from "./VotesDetails";
2627

2728
const Container = styled.div``;
2829

2930
const StyledTabs = styled(Tabs)`
3031
width: 100%;
3132
margin-bottom: 16px;
33+
margin-top: 48px;
3234
`;
3335

3436
const Header = styled.div`
@@ -69,6 +71,8 @@ const VotingHistory: React.FC<{ arbitrable?: `0x${string}`; isQuestion: boolean
6971
[votingHistory, currentTab]
7072
);
7173

74+
const jurorRewardsDispersed = useMemo(() => Boolean(rounds?.every((round) => round.jurorRewardsDispersed)), [rounds]);
75+
7276
return (
7377
<Container>
7478
<Header>
@@ -90,6 +94,10 @@ const VotingHistory: React.FC<{ arbitrable?: `0x${string}`; isQuestion: boolean
9094
)}
9195
</>
9296
)}
97+
<RulingAndRewardsIndicators
98+
ruled={Boolean(disputeData?.dispute?.ruled)}
99+
jurorRewardsDispersed={jurorRewardsDispersed}
100+
/>
93101
<StyledTabs
94102
currentValue={currentTab}
95103
items={rounds.map((_, i) => ({

0 commit comments

Comments
 (0)