diff --git a/apps/dapp/components/ProposalDetailsSidebar.tsx b/apps/dapp/components/ProposalDetailsSidebar.tsx index efb9de6cf..1272b3c63 100644 --- a/apps/dapp/components/ProposalDetailsSidebar.tsx +++ b/apps/dapp/components/ProposalDetailsSidebar.tsx @@ -271,9 +271,13 @@ export const ProposalDetailsVoteStatus = ({ ? expirationAtTimeToSecondsFromNow(proposal.expires) : undefined + // TODO: Change this wen v1 contracts launch, since the conditions + // will change. In v1, all abstain fails instead of passes. const thresholdReached = !!threshold && - (quorum ? turnoutYesPercent : totalYesPercent) >= threshold.percent + yesVotes >= + ((quorum ? turnoutTotal : totalWeight) - abstainVotes) * + (threshold.percent / 100) const quorumMet = !!quorum && turnoutPercent >= quorum.percent const helpfulStatusText = @@ -287,6 +291,11 @@ export const ProposalDetailsVoteStatus = ({ : undefined : undefined + // When only abstain votes have been cast and there is no quorum, + // align the abstain progress bar to the right to line up with Abstain + // text. + const onlyAbstain = yesVotes === 0 && noVotes === 0 && abstainVotes > 0 + return (
{helpfulStatusText && ( @@ -530,6 +539,7 @@ export const ProposalDetailsVoteStatus = ({
0 && ( - <> -

- Time left -

+ {proposal.status === 'open' && + expiresInSeconds !== undefined && + expiresInSeconds > 0 && ( + <> +

+ Time left +

-

- {secondsToWdhms(expiresInSeconds, 2)} -

+

+ {secondsToWdhms(expiresInSeconds, 2)} +

- {maxVotingSeconds !== undefined && ( -
- -
- )} - - )} + {maxVotingSeconds !== undefined && ( +
+ +
+ )} + + )} - {threshold?.percent === 50 && yesVotes === noVotes && ( + {threshold?.percent === 50 && yesVotes === noVotes && yesVotes > 0 && (

Tie clarification

@@ -655,7 +667,8 @@ export const ProposalDetailsVoteStatus = ({

{/* TODO: Change this to fail wen v1 contracts. */} - When all abstain, a proposal will pass. + When all abstain{quorum && ' and the quorum is met'}, a proposal + will pass.

)}