From 4042b35b5afb3d42096cbd61aa535cef5c0958d0 Mon Sep 17 00:00:00 2001 From: Zeke Medley Date: Mon, 28 Mar 2022 17:08:31 -0700 Subject: [PATCH] Allow voting abstain on proposals. --- apps/dapp/components/ProposalDetails.tsx | 108 ++++++++++++++--------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/apps/dapp/components/ProposalDetails.tsx b/apps/dapp/components/ProposalDetails.tsx index a505fe37c0..61e9e7cc1a 100644 --- a/apps/dapp/components/ProposalDetails.tsx +++ b/apps/dapp/components/ProposalDetails.tsx @@ -16,6 +16,7 @@ import { ExternalLinkIcon, EyeIcon, EyeOffIcon, + MinusIcon, SparklesIcon, XIcon, } from '@heroicons/react/outline' @@ -65,7 +66,7 @@ import { CosmosMessageDisplay } from './CosmosMessageDisplay' import { getEnd } from './ProposalList' function executeProposalVote( - vote: 'yes' | 'no', + vote: 'yes' | 'no' | 'abstain', id: number, contractAddress: string, signingClient: SigningCosmWasmClient | null, @@ -148,6 +149,7 @@ function LoadingButton() { function ProposalVoteButtons({ yesCount, noCount, + abstainCount, proposalId, contractAddress, voted, @@ -156,6 +158,7 @@ function ProposalVoteButtons({ }: { yesCount: string noCount: string + abstainCount: string proposalId: number contractAddress: string voted: boolean @@ -196,15 +199,17 @@ function ProposalVoteButtons({ position, children, }: { - position: 'yes' | 'no' + position: 'yes' | 'no' | 'abstain' children: ReactNode }) => (