Skip to content

Commit

Permalink
Show sum of my vote stakes on CandidateVote (Joystream#2985)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joystream Stats committed Oct 31, 2022
1 parent 6f249a2 commit 2437031
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { CandidateCardArrow, StatsValue } from '../CandidateCard/CandidateCard'

import { RevealVoteButton } from './RevealVoteButton'

const getStakeFromVotes = (votes: MyCastVote[]) => new BN(100) // TODO votes have no stake info => QN

export interface CandidateVoteProps {
candidateId: string
member: Member
Expand Down Expand Up @@ -53,6 +55,7 @@ export const CandidateVote = ({
const hasOwnStake = ownStake && ownStake.gt(BN_ZERO)
const hasMyVotes = myVotes.length > 0
const allVotesRevealed = myVotes.every((vote) => vote.voteFor)
const myStake = getStakeFromVotes(myVotes) // TODO
return (
<CandidateVoteWrapper onClick={showCandidate}>
<VoteIndex lighter inter>
Expand All @@ -78,7 +81,7 @@ export const CandidateVote = ({
<>
<Subscription>My Stake</Subscription>
<StatsValue>
<TokenValue value={ownStake} />
<TokenValue value={myStake} />
</StatsValue>
</>
)}
Expand Down

0 comments on commit 2437031

Please sign in to comment.