Skip to content

Commit

Permalink
hide vote if past active
Browse files Browse the repository at this point in the history
  • Loading branch information
brightiron committed Apr 18, 2024
1 parent 0d3604f commit 06d963a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/views/Governance/Components/CurrentVotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,15 @@ export const CurrentVotes = ({ proposalId, onVoteClick }: { proposalId: number;
againstVotes={proposalDetails?.againstCount}
abstainVotes={proposalDetails?.abstainCount}
/>
<WalletConnectedGuard fullWidth buttonText="Connect to Vote">
<PrimaryButton onClick={onVoteClick} disabled={hasVoted || proposalDetails?.status !== "Active"}>
{hasVoted ? `Voted (${support})` : "Vote"}
</PrimaryButton>
</WalletConnectedGuard>
{(proposalDetails?.status == "Active" ||
proposalDetails?.status == "Pending" ||
proposalDetails?.status == "Emergency") && (
<WalletConnectedGuard fullWidth buttonText="Connect to Vote">
<PrimaryButton onClick={onVoteClick} disabled={hasVoted || proposalDetails?.status !== "Active"}>
{hasVoted ? `Voted (${support})` : "Vote"}
</PrimaryButton>
</WalletConnectedGuard>
)}
</Box>
</Paper>
);
Expand Down

0 comments on commit 06d963a

Please sign in to comment.