From e8d16983dd2af4b9c968a2e31758f984af5fde73 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 15 Apr 2022 20:00:24 -0700 Subject: [PATCH] Only show time left when proposal is open. --- .../components/ProposalDetailsSidebar.tsx | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/apps/dapp/components/ProposalDetailsSidebar.tsx b/apps/dapp/components/ProposalDetailsSidebar.tsx index efb9de6cf..9105820b6 100644 --- a/apps/dapp/components/ProposalDetailsSidebar.tsx +++ b/apps/dapp/components/ProposalDetailsSidebar.tsx @@ -610,36 +610,38 @@ export const ProposalDetailsVoteStatus = ({ ) ) : null} - {expiresInSeconds !== undefined && expiresInSeconds > 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 && (