From eed6a835724c343477252eea391d2f35dda7dea1 Mon Sep 17 00:00:00 2001 From: Dexter Edwards Date: Tue, 9 Aug 2022 16:54:41 +0100 Subject: [PATCH] chore: show total supply on governance page (#967) * chore: show total supply on governance page * Update apps/token/src/i18n/translations/dev.json Co-authored-by: Edd * Update apps/token/src/i18n/translations/dev.json Co-authored-by: Edd --- apps/token/src/i18n/translations/dev.json | 3 ++- .../proposal-votes-table/proposal-votes-table.tsx | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/token/src/i18n/translations/dev.json b/apps/token/src/i18n/translations/dev.json index a90608a8e..7f6731a68 100644 --- a/apps/token/src/i18n/translations/dev.json +++ b/apps/token/src/i18n/translations/dev.json @@ -625,5 +625,6 @@ "FilterProposalsDescription": "Filter by proposal ID or proposer ID", "Freeform proposal": "Freeform proposal", "NewProposal": "New proposal", - "MinProposalRequirements": "You must have at least 1 VEGA to make a proposal" + "MinProposalRequirements": "You must have at least 1 VEGA associated to make a proposal", + "totalSupply": "Total Supply" } diff --git a/apps/token/src/routes/governance/components/proposal-votes-table/proposal-votes-table.tsx b/apps/token/src/routes/governance/components/proposal-votes-table/proposal-votes-table.tsx index c81618da9..3eace6179 100644 --- a/apps/token/src/routes/governance/components/proposal-votes-table/proposal-votes-table.tsx +++ b/apps/token/src/routes/governance/components/proposal-votes-table/proposal-votes-table.tsx @@ -7,6 +7,7 @@ import { } from '../../../../lib/format-number'; import { useVoteInformation } from '../../hooks'; import type { Proposals_proposals } from '../../proposals/__generated__/Proposals'; +import { useAppState } from '../../../../contexts/app-state/app-state-context'; interface ProposalVotesTableProps { proposal: Proposals_proposals; @@ -14,6 +15,9 @@ interface ProposalVotesTableProps { export const ProposalVotesTable = ({ proposal }: ProposalVotesTableProps) => { const { t } = useTranslation(); + const { + appState: { totalSupply }, + } = useAppState(); const { willPass, totalTokensPercentage, @@ -55,6 +59,10 @@ export const ProposalVotesTable = ({ proposal }: ProposalVotesTableProps) => { {t('tokenForProposal')} {formatNumber(yesTokens, 2)} + + {t('totalSupply')} + {formatNumber(totalSupply, 2)} + {t('tokensAgainstProposal')} {formatNumber(noTokens, 2)}