feat(governance): voting blog link and button title (#3717)

This commit is contained in:
Sam Keen 2023-05-11 13:59:28 +01:00 committed by GitHub
parent bf73559c30
commit b641c82ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 5 deletions

View File

@ -202,6 +202,7 @@
"tokenVotes": "Token votes", "tokenVotes": "Token votes",
"liquidityVotes": "Liquidity votes", "liquidityVotes": "Liquidity votes",
"castYourVote": "Cast your vote", "castYourVote": "Cast your vote",
"yourVote": "Your vote",
"for": "For", "for": "For",
"against": "Against", "against": "Against",
"majorityRequired": "Majority Required", "majorityRequired": "Majority Required",

View File

@ -111,7 +111,9 @@ describe('Vote buttons', () => {
</AppStateProvider> </AppStateProvider>
); );
expect( expect(
screen.getByText('You need some VEGA tokens to participate in governance') screen.getByText(
'You need some VEGA tokens to participate in governance.'
)
).toBeTruthy(); ).toBeTruthy();
}); });

View File

@ -2,7 +2,12 @@ import { format } from 'date-fns';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet'; import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
import { AsyncRenderer, Button, ButtonLink } from '@vegaprotocol/ui-toolkit'; import {
AsyncRenderer,
Button,
ButtonLink,
ExternalLink,
} from '@vegaprotocol/ui-toolkit';
import { addDecimal, toBigNum } from '@vegaprotocol/utils'; import { addDecimal, toBigNum } from '@vegaprotocol/utils';
import { ProposalState, VoteValue } from '@vegaprotocol/types'; import { ProposalState, VoteValue } from '@vegaprotocol/types';
import { import {
@ -161,7 +166,12 @@ export const VoteButtons = ({
{changeVote || (voteState === VoteState.NotCast && proposalVotable) ? ( {changeVote || (voteState === VoteState.NotCast && proposalVotable) ? (
<> <>
{currentStakeAvailable.isLessThanOrEqualTo(0) && ( {currentStakeAvailable.isLessThanOrEqualTo(0) && (
<p data-testid="no-stake-available">{t('noGovernanceTokens')}</p> <>
<p data-testid="no-stake-available">{t('noGovernanceTokens')}.</p>
<ExternalLink href="https://blog.vega.xyz/how-to-vote-on-vega-2195d1e52ec5">
{t('findOutMoreAboutHowToVote')}
</ExternalLink>
</>
)} )}
<div className="flex gap-4" data-testid="vote-buttons"> <div className="flex gap-4" data-testid="vote-buttons">

View File

@ -1,6 +1,6 @@
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { formatDistanceToNow } from 'date-fns'; import { formatDistanceToNow } from 'date-fns';
import { RoundedWrapper, Icon } from '@vegaprotocol/ui-toolkit'; import { RoundedWrapper, Icon, ExternalLink } from '@vegaprotocol/ui-toolkit';
import { useVegaWallet } from '@vegaprotocol/wallet'; import { useVegaWallet } from '@vegaprotocol/wallet';
import { ProposalState } from '@vegaprotocol/types'; import { ProposalState } from '@vegaprotocol/types';
import { useVoteSubmit, VoteProgress } from '@vegaprotocol/proposals'; import { useVoteSubmit, VoteProgress } from '@vegaprotocol/proposals';
@ -202,7 +202,12 @@ export const VoteDetails = ({
)} )}
<section className="mt-10"> <section className="mt-10">
<SubHeading title={t('castYourVote')} /> {proposal?.state === ProposalState.STATE_OPEN ? (
<SubHeading title={t('castYourVote')} />
) : (
<SubHeading title={t('yourVote')} />
)}
{pubKey ? ( {pubKey ? (
proposal && ( proposal && (
<VoteButtonsContainer <VoteButtonsContainer
@ -224,6 +229,9 @@ export const VoteDetails = ({
<Icon name={'info-sign'} /> <Icon name={'info-sign'} />
<div>{t('connectAVegaWalletToVote')}</div> <div>{t('connectAVegaWalletToVote')}</div>
</div> </div>
<ExternalLink href="https://blog.vega.xyz/how-to-vote-on-vega-2195d1e52ec5">
{t('findOutMoreAboutHowToVote')}
</ExternalLink>
</div> </div>
<ConnectToVega /> <ConnectToVega />
</RoundedWrapper> </RoundedWrapper>