Skip to content

Commit 96245e3

Browse files
kemurujaybuidl
authored andcommitted
feat(web): round info on dispute card
1 parent b714c12 commit 96245e3

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed
Lines changed: 10 additions & 0 deletions
Loading

web/src/components/DisputeCard/DisputeInfo.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import BookmarkIcon from "svgs/icons/bookmark.svg";
55
import CalendarIcon from "svgs/icons/calendar.svg";
66
import LawBalanceIcon from "svgs/icons/law-balance.svg";
77
import PileCoinsIcon from "svgs/icons/pile-coins.svg";
8+
import RoundIcon from "svgs/icons/round.svg";
89
import Field from "../Field";
910

1011
const Container = styled.div`
@@ -33,13 +34,15 @@ export interface IDisputeInfo {
3334
rewards?: string;
3435
period?: Periods;
3536
date?: number;
37+
round?: number;
3638
}
3739

38-
const DisputeInfo: React.FC<IDisputeInfo> = ({ courtId, court, category, rewards, period, date }) => {
40+
const DisputeInfo: React.FC<IDisputeInfo> = ({ courtId, court, category, rewards, period, date, round }) => {
3941
return (
4042
<Container>
41-
{category && <Field icon={BookmarkIcon} name="Category" value={category} />}
4243
{court && courtId && <Field icon={LawBalanceIcon} name="Court" value={court} link={`/courts/${courtId}`} />}
44+
{category && <Field icon={BookmarkIcon} name="Category" value={category} />}
45+
{round && <Field icon={RoundIcon} name="Round" value={round.toString()} />}
4346
{rewards && <Field icon={PileCoinsIcon} name="Juror Rewards" value={rewards} />}
4447
{typeof period !== "undefined" && date && (
4548
<Field icon={CalendarIcon} name={getPeriodPhrase(period)} value={new Date(date * 1000).toLocaleString()} />

web/src/components/DisputeCard/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useDisputeTemplate } from "queries/useDisputeTemplate";
1111
import DisputeInfo from "./DisputeInfo";
1212
import PeriodBanner from "./PeriodBanner";
1313
import { isUndefined } from "utils/index";
14+
import { useVotingHistory } from "hooks/queries/useVotingHistory";
1415

1516
const StyledCard = styled(Card)`
1617
max-width: 380px;
@@ -61,6 +62,8 @@ const DisputeCard: React.FC<CasesPageQuery["disputes"][number]> = ({
6162
const { data: courtPolicy } = useCourtPolicy(court.id);
6263
const courtName = courtPolicy?.name;
6364
const category = disputeTemplate ? disputeTemplate.category : undefined;
65+
const { data: votingHistory } = useVotingHistory(id);
66+
const localRounds = votingHistory?.dispute?.disputeKitDispute?.localRounds;
6467
const navigate = useNavigate();
6568
return (
6669
<StyledCard hover onClick={() => navigate(`/cases/${id.toString()}`)}>
@@ -71,6 +74,7 @@ const DisputeCard: React.FC<CasesPageQuery["disputes"][number]> = ({
7174
courtId={court?.id}
7275
court={courtName}
7376
period={currentPeriodIndex}
77+
round={localRounds?.length}
7478
{...{ category, rewards, date }}
7579
/>
7680
</Container>

0 commit comments

Comments
 (0)