From 3980247a7fabd87a8476a996ff3bd835e40c346b Mon Sep 17 00:00:00 2001 From: Rico Wong Date: Thu, 30 Jun 2022 02:34:48 +0800 Subject: [PATCH] react-app: Handle remind to vote button for proposal vote list refs #128 --- .../ProposalVotesPanel.tsx | 36 ++++++++++++++++++- react-app/src/i18n/translations/en.json | 1 + react-app/src/i18n/translations/zh.json | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/react-app/src/components/ProposalDetailScreen/ProposalVotesPanel.tsx b/react-app/src/components/ProposalDetailScreen/ProposalVotesPanel.tsx index 54ab07445..de62740b3 100644 --- a/react-app/src/components/ProposalDetailScreen/ProposalVotesPanel.tsx +++ b/react-app/src/components/ProposalDetailScreen/ProposalVotesPanel.tsx @@ -4,7 +4,7 @@ import { useOutletContext, useSearchParams } from "react-router-dom"; import { toast } from "react-toastify"; import TallyResultIndicator from "../TallyResultIndicator/TallyResultIndicator"; import * as SectionedTable from "../SectionedTable/SectionedTable"; -import { VoteOption } from "../../models/cosmos/gov"; +import { ProposalStatus, VoteOption } from "../../models/cosmos/gov"; import LocalizedText from "../common/Localized/LocalizedText"; import { isRequestStateError, @@ -12,6 +12,7 @@ import { } from "../../models/RequestState"; import PageContoller from "../common/PageController/PageController"; import { useLocale } from "../../providers/AppLocaleProvider"; +import AppButton from "../common/Buttons/AppButton"; import { Proposal, ProposalVote, @@ -147,6 +148,33 @@ const ProposalVoteOption: React.FC<{ option: VoteOption | null }> = ({ } }; +const RemindToVoteButton: React.FC<{ + proposal: Proposal; + vote: ProposalVote; +}> = ({ proposal, vote }) => { + if ( + vote.option != null || + vote.voter.__typename !== "Validator" || + vote.voter.securityContact == null || + proposal.status !== ProposalStatus.VotingPeriod + ) { + return null; + } + + const email: string = vote.voter.securityContact; + + return ( + + ); +}; + const ProposalVotesPanel: React.FC = () => { const proposal = useOutletContext(); const { translate } = useLocale(); @@ -266,6 +294,12 @@ const ProposalVotesPanel: React.FC = () => { > {(item) => } + + id="action" + className={cn("text-right")} + > + {(item) => } +