Skip to content

Commit

Permalink
Sort by and show PastElections end block (Joystream#3168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joystream Stats committed Dec 9, 2022
1 parent 100a20d commit 5197f9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const PastElections = () => {
<>
<PastElectionsListHeaders $colLayout={PastElectionsColLayout}>
<SortHeader {...getSortProps('cycleId')}>Round</SortHeader>
<SortHeader {...getSortProps('updatedAt')}>Election started at</SortHeader>
<SortHeader {...getSortProps('endedAtBlock')}>Election ended at</SortHeader>
<ListHeader>Total staked</ListHeader>
<ListHeader>Revealed votes</ListHeader>
<ListHeader>Total candidates</ListHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ interface PastElectionsListRowProps {
}

export const PastElectionsListRow = ({ election }: PastElectionsListRowProps) => {
const endedAt = election.finishedAtBlock
return (
<PastElectionsListRowItem
$colLayout={PastElectionsColLayout}
as={GhostRouterLink}
to={generatePath(ElectionRoutes.pastElection, { id: election.id })}
>
<Info>#{election.cycleId}</Info>
{election.finishedAtBlock ? (
<BlockTime block={election.finishedAtBlock} layout="reverse-start" lessInfo />
) : (
<></>
)}
{endedAt ? <BlockTime block={endedAt} layout="reverse-start" lessInfo /> : <></>}
<TokenValue value={election.totalStake} />
<Fraction numerator={election.revealedVotes} denominator={election.totalVotes} sameSize />
<CountInfo count={election.totalCandidates} />
Expand Down

0 comments on commit 5197f9c

Please sign in to comment.