Skip to content

Commit

Permalink
Only show time left when proposal is open.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Apr 16, 2022
1 parent a088f2a commit e8d1698
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions apps/dapp/components/ProposalDetailsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -610,36 +610,38 @@ export const ProposalDetailsVoteStatus = ({
)
) : null}

{expiresInSeconds !== undefined && expiresInSeconds > 0 && (
<>
<p className="overflow-hidden mt-4 font-mono text-sm text-tertiary text-ellipsis">
Time left
</p>
{proposal.status === 'open' &&
expiresInSeconds !== undefined &&
expiresInSeconds > 0 && (
<>
<p className="overflow-hidden mt-4 font-mono text-sm text-tertiary text-ellipsis">
Time left
</p>

<p className="font-mono text-xs text-right text-dark">
{secondsToWdhms(expiresInSeconds, 2)}
</p>
<p className="font-mono text-xs text-right text-dark">
{secondsToWdhms(expiresInSeconds, 2)}
</p>

{maxVotingSeconds !== undefined && (
<div className="mt-1">
<Progress
alignEnd
rows={[
{
thickness: 3,
data: [
{
value: (expiresInSeconds / maxVotingSeconds) * 100,
color: 'rgb(var(--dark))',
},
],
},
]}
/>
</div>
)}
</>
)}
{maxVotingSeconds !== undefined && (
<div className="mt-1">
<Progress
alignEnd
rows={[
{
thickness: 3,
data: [
{
value: (expiresInSeconds / maxVotingSeconds) * 100,
color: 'rgb(var(--dark))',
},
],
},
]}
/>
</div>
)}
</>
)}

{threshold?.percent === 50 && yesVotes === noVotes && (
<div className="mt-4 text-sm">
Expand Down

0 comments on commit e8d1698

Please sign in to comment.