setAmount(e.target.value)}
- value={amount}
- autoComplete="off"
- type="number"
- max={maximum.toString()}
- min={0}
- step="any"
- />
+
@@ -69,7 +75,6 @@ export const TokenInput = ({
perform,
submitText,
currency,
-
approveText,
allowance,
approve,
@@ -84,7 +89,6 @@ export const TokenInput = ({
perform: () => void;
submitText: string;
currency: string;
-
requireApproval?: boolean;
maximum?: BigNumber;
minimum?: BigNumber;
@@ -128,6 +132,7 @@ export const TokenInput = ({
new BigNumber(amount).isLessThan(minimum)
);
}, [amount, isApproved, maximum, requireApproval, minimum]);
+
let approveContent = null;
if (showApproveButton) {
@@ -158,11 +163,9 @@ export const TokenInput = ({
}
} else if (requireApproval) {
approveContent = (
-
);
}
diff --git a/apps/token/src/components/transaction-button/index.ts b/apps/token/src/components/transaction-button/index.ts
deleted file mode 100644
index de6ffbb9b..000000000
--- a/apps/token/src/components/transaction-button/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './transaction-button';
diff --git a/apps/token/src/components/transaction-button/transaction-button.tsx b/apps/token/src/components/transaction-button/transaction-button.tsx
deleted file mode 100644
index cee44867a..000000000
--- a/apps/token/src/components/transaction-button/transaction-button.tsx
+++ /dev/null
@@ -1,159 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import type { TransactionState } from '../../hooks/transaction-reducer';
-import { TxState } from '../../hooks/transaction-reducer';
-import { truncateMiddle } from '../../lib/truncate-middle';
-import { Button, Link } from '@vegaprotocol/ui-toolkit';
-import { useEnvironment } from '@vegaprotocol/react-helpers';
-import { Error, HandUp, Tick } from '../icons';
-import { Loader } from '../loader';
-import { StatefulButton } from '../stateful-button';
-
-interface TransactionButtonProps {
- text: string;
- transactionState: TransactionState;
- /** txHash of the transaction if already complete */
- forceTxHash: string | null;
- forceTxState?: TxState;
- disabled?: boolean;
- start: () => void;
- reset: () => void;
-}
-
-const Wrapper = ({ children }: { children: React.ReactNode }) => (
-
-);
-
-export const TransactionButton = ({
- text,
- transactionState,
- forceTxHash,
- forceTxState,
- disabled = false,
- start,
- reset,
-}: TransactionButtonProps) => {
- const { t } = useTranslation();
- const { txState, txData } = transactionState;
- const txHash = forceTxHash || txData.hash;
- const state = forceTxState || txState;
-
- if (state === TxState.Complete) {
- return (
-
- );
- }
-
- // User as started transaction and we are awaiting confirmation from the users wallet
- if (state === TxState.Requested) {
- return (
-
- );
-};
-
-interface TransactionButtonFooterProps {
- txHash: string | null;
- message?: string;
-}
-
-export const TransactionButtonFooter = ({
- txHash,
- message,
-}: TransactionButtonFooterProps) => {
- const { ETHERSCAN_URL } = useEnvironment();
- const { t } = useTranslation();
-
- if (message) {
- return (
-
- );
- }
-
- return null;
-};
diff --git a/apps/token/src/components/transaction-callout/transaction-complete.tsx b/apps/token/src/components/transaction-callout/transaction-complete.tsx
index dcb8263ee..a9a1214cc 100644
--- a/apps/token/src/components/transaction-callout/transaction-complete.tsx
+++ b/apps/token/src/components/transaction-callout/transaction-complete.tsx
@@ -23,13 +23,18 @@ export const TransactionComplete = ({
intent={Intent.Success}
title={heading || t('Complete')}
>
- {body &&
}
diff --git a/apps/token/src/components/transaction-callout/transaction-error.tsx b/apps/token/src/components/transaction-callout/transaction-error.tsx
index 22be01b1a..0bbee8cb2 100644
--- a/apps/token/src/components/transaction-callout/transaction-error.tsx
+++ b/apps/token/src/components/transaction-callout/transaction-error.tsx
@@ -20,12 +20,15 @@ export const TransactionError = ({
return (
- {error ? error.message : t('Something went wrong')}
+
+ {error ? error.message : t('Something went wrong')}
+
{hash ? (
-
+
{hash}
diff --git a/apps/token/src/components/transaction-callout/transaction-pending.tsx b/apps/token/src/components/transaction-callout/transaction-pending.tsx
index 4a2f291bc..604044f1a 100644
--- a/apps/token/src/components/transaction-callout/transaction-pending.tsx
+++ b/apps/token/src/components/transaction-callout/transaction-pending.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Callout } from '@vegaprotocol/ui-toolkit';
+import { Callout, Loader } from '@vegaprotocol/ui-toolkit';
import { useTranslation } from 'react-i18next';
import { Link } from '@vegaprotocol/ui-toolkit';
import { useEnvironment } from '@vegaprotocol/react-helpers';
@@ -37,11 +37,16 @@ export const TransactionPending = ({
return defaultTitle;
}, [heading, remainingConfirmations, t]);
return (
-
- {body && {body}
}
-
+ } title={title}>
+ {body && (
+
+ {body}
+
+ )}
+
{hash}
diff --git a/apps/token/src/components/transaction-callout/transaction-requested.tsx b/apps/token/src/components/transaction-callout/transaction-requested.tsx
index 300b65705..f8146559d 100644
--- a/apps/token/src/components/transaction-callout/transaction-requested.tsx
+++ b/apps/token/src/components/transaction-callout/transaction-requested.tsx
@@ -7,7 +7,7 @@ export const TransactionRequested = () => {
);
};
diff --git a/apps/token/src/components/transactions-modal/transactions-modal.tsx b/apps/token/src/components/transactions-modal/transactions-modal.tsx
index 6a9887ba0..c886afb5f 100644
--- a/apps/token/src/components/transactions-modal/transactions-modal.tsx
+++ b/apps/token/src/components/transactions-modal/transactions-modal.tsx
@@ -85,6 +85,7 @@ export const TransactionModal = () => {
{truncateMiddle(transaction.tx.hash)}
diff --git a/apps/token/src/components/vega-wallet/download-wallet-prompt.tsx b/apps/token/src/components/vega-wallet/download-wallet-prompt.tsx
index 1343e9a14..9470f7dfc 100644
--- a/apps/token/src/components/vega-wallet/download-wallet-prompt.tsx
+++ b/apps/token/src/components/vega-wallet/download-wallet-prompt.tsx
@@ -1,31 +1,22 @@
+import { Link } from '@vegaprotocol/ui-toolkit';
import { useTranslation } from 'react-i18next';
import { Links } from '../../config';
export const DownloadWalletPrompt = () => {
const { t } = useTranslation();
return (
- <>
+
);
};
diff --git a/apps/token/src/components/vega-wallet/vega-wallet.tsx b/apps/token/src/components/vega-wallet/vega-wallet.tsx
index b799a0d34..79b582949 100644
--- a/apps/token/src/components/vega-wallet/vega-wallet.tsx
+++ b/apps/token/src/components/vega-wallet/vega-wallet.tsx
@@ -41,10 +41,8 @@ export const VegaWallet = () => {
-
{t('vegaWallet')}
-
- {keypair && `(${keypair.name})`}
-
+ {t('vegaWallet')}
+ {keypair && `(${keypair.name})`}
{keypair && (
@@ -72,6 +70,7 @@ const VegaWalletNotConnected = () => {
})
}
variant="secondary"
+ className="w-full"
data-testid="connect-vega"
>
{t('connectVegaWalletToUseAssociated')}
@@ -182,10 +181,14 @@ const VegaWalletConnected = ({ vegaKeys }: VegaWalletConnectedProps) => {
))}
-
+
+ {t('governance')}
+
-
+
+ {t('staking')}
+
diff --git a/apps/token/src/components/wallet-card/wallet-card.tsx b/apps/token/src/components/wallet-card/wallet-card.tsx
index d7d20d4ca..2d4156e2b 100644
--- a/apps/token/src/components/wallet-card/wallet-card.tsx
+++ b/apps/token/src/components/wallet-card/wallet-card.tsx
@@ -1,3 +1,4 @@
+import classNames from 'classnames';
import React from 'react';
import { Link } from 'react-router-dom';
@@ -27,15 +28,13 @@ interface WalletCardProps {
dark?: boolean;
}
-export const WalletCard = ({ dark, children }: WalletCardProps) => (
-
- {children}
-
-);
+export const WalletCard = ({ dark, children }: WalletCardProps) => {
+ const className = classNames('text-ui border border-white', 'p-8', {
+ 'bg-black text-white': dark,
+ 'bg-white text-black': !dark,
+ });
+ return {children}
;
+};
interface WalletCardHeaderProps {
children: React.ReactNode;
@@ -44,7 +43,7 @@ interface WalletCardHeaderProps {
export const WalletCardHeader = ({ children }: WalletCardHeaderProps) => {
return (
- {children}
+ {children}
);
};
@@ -53,7 +52,7 @@ interface WalletCardContentProps {
}
export const WalletCardContent = ({ children }: WalletCardContentProps) => {
- return {children}
;
+ return {children}
;
};
export const WalletCardRow = ({
diff --git a/apps/token/src/hooks/use-copy-to-clipboard.ts b/apps/token/src/hooks/use-copy-to-clipboard.ts
deleted file mode 100644
index 28e0f3ffb..000000000
--- a/apps/token/src/hooks/use-copy-to-clipboard.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import * as React from 'react';
-
-export function useCopyToClipboard() {
- const [copied, setCopied] = React.useState(false);
-
- // Once copied flip a boolean so we can display
- // a message to the user such as 'Copied!' which will
- // revert after 800 milliseconds
- React.useEffect(() => {
- let timeout: ReturnType;
- if (copied) {
- timeout = setTimeout(() => {
- setCopied(false);
- }, 800);
- }
- return () => clearTimeout(timeout);
- }, [copied]);
-
- // Create an input we can copy text from and render it
- // off screen
- function handler(text: string) {
- const input = document.createElement('input');
- input.style.position = 'fixed';
- input.style.left = '100vw';
- input.style.opacity = '0';
- input.value = text;
- document.body.appendChild(input);
- input.select();
- document.execCommand('copy');
- document.body.removeChild(input);
- setCopied(true);
- }
-
- return {
- copy: handler,
- copied,
- };
-}
diff --git a/apps/token/src/i18n/translations/dev.json b/apps/token/src/i18n/translations/dev.json
index 27ce04728..bc61ef421 100644
--- a/apps/token/src/i18n/translations/dev.json
+++ b/apps/token/src/i18n/translations/dev.json
@@ -1,9 +1,9 @@
{
"Home": "Home",
"fairgroundTitle": "Fairground token",
- "pageTitleHome": "$VEGA Tokens",
+ "pageTitleHome": "The $VEGA token",
"pageTitleClaim": "Claim $VEGA tokens",
- "pageTitleAssociate": "Associate $VEGA tokens with $VEGA Key",
+ "pageTitleAssociate": "Associate $VEGA tokens with Vega Key",
"pageTitleRedemption": "Vesting",
"pageTitleLiquidity": "Incentivised Liquidity Programme",
"pageTitleRedemptionTranche": "Redeem from Tranche",
@@ -79,6 +79,7 @@
"Incomplete": "Incomplete",
"Complete": "Complete",
"View on Etherscan (opens in a new tab)": "View on Etherscan (opens in a new tab)",
+ "View transaction on Etherscan": "View transaction on Etherscan",
"Transaction in progress": "Transaction in progress",
"Unknown error": "Unknown error",
"Awaiting action in Ethereum wallet (e.g. MetaMask)": "Awaiting action in Ethereum wallet (e.g. MetaMask)",
@@ -126,7 +127,6 @@
"noVestingTokens": "You do not have any vesting $VEGA tokens. Switch to another Ethereum address to check what can be redeemed, or view all tranches",
"ethereumKey": "Ethereum key",
"checkingForProvider": "Checking for provider",
- "Awaiting action in wallet...": "Awaiting action in Ethereum wallet (e.g. MetaMask)",
"In wallet": "In wallet",
"Not staked": "Not staked",
"viewKeys": "View keys",
@@ -149,7 +149,6 @@
"Stake VEGA tokens": "Stake $VEGA tokens",
"Tranche breakdown": "Tranche breakdown",
"Across all tranches": "Across all tranches",
- "theVegaToken": "The {{symbol}} token",
"Token Vesting": "Vesting",
"Rewards": "Rewards",
"Governance": "Governance",
@@ -238,7 +237,7 @@
"VEGA Tokens": "$VEGA Tokens",
"SLP Tokens": "SLP Tokens",
"Connected Vega key": "Connected Vega key",
- "What Vega wallet/key is going to control your stake?": "What Vega Wallet/key is going to control your stake?",
+ "What Vega key is going to control your stake?": "What Vega key is going to control your stake?",
"Where would you like to stake from?": "Where would you like to associate from?",
"associateNoVega": "Your connected Ethereum address does not have any $VEGA",
"associateInfo1": "To participate in governance or to nominate a Validator you'll need to associate $VEGA tokens with a Vega wallet/key.",
@@ -322,7 +321,7 @@
"Associate VEGA tokens": "Associate $VEGA tokens",
"VEGA token holders can vote on proposed changes to the network and create proposals.": "$VEGA token holders can vote on proposed changes to the network and create proposals.",
"VEGA token holders can nominate a validator node and receive staking rewards.": "$VEGA token holders can nominate a validator node and receive staking rewards.",
- "USE YOUR VEGA TOKENS": "USE YOUR $VEGA TOKENS",
+ "Use your Vega tokens": "Use your Vega tokens",
"Check your vesting VEGA tokens": "Check your vesting $VEGA tokens",
"Tokens from this Tranche have been redeemed": "Tokens from this Tranche have been redeemed",
"You have redeemed {{redeemedAmount}} VEGA tokens from this tranche. They are now free to transfer from your Ethereum wallet.": "You have redeemed {{redeemedAmount}} $VEGA tokens from this tranche. They are now free to transfer from your Ethereum wallet.",
@@ -450,12 +449,12 @@
"transaction": "Transaction",
"associated": "Associated",
"notAssociated": "Not Associated",
- "title": "$VEGA TOKEN",
+ "title": "VEGA TOKEN",
"Use the Ethereum wallet you want to send your tokens to. You'll also need enough Ethereum to pay gas.": "Connect to the Ethereum wallet that holds your $VEGA tokens to see what can be redeemed from vesting tranches. To redeem tokens you will need some ETH to pay gas fees.\n",
"Staked on Vega validator": "Staked $VEGA",
"You can associate tokens while they are held in the vesting contract, when they unlock you will need to disassociate them before they can be redeemed.": "You can associate tokens while they are held in the vesting contract, when they unlock you will need to disassociate them before they can be redeemed.",
"Nominate Stake to Validator Node": "Select a validator to nominate",
- "Vega key {{vegaKey}} can now participate in governance and Nominate a validator with it's stake.": "Vega key {{vegaKey}} can now participate in governance and nominate a validator with your associated $VEGA.",
+ "successfullAssociationMessage": "Vega key {{vegaKey}} can now participate in governance and nominate a validator with your associated $VEGA.",
"stakingStep2Text": "Your tokens need to be associated with a Vega Wallet so that you can control your stake",
"stakingStep3": "Step 3. Select the validator you'd like to nominate",
"stakeAddSuccessMessage": "You can cancel your nomination at any time",
diff --git a/apps/token/src/routes/claim/complete.tsx b/apps/token/src/routes/claim/complete.tsx
index d0b0b9f39..9cb3f7fd9 100644
--- a/apps/token/src/routes/claim/complete.tsx
+++ b/apps/token/src/routes/claim/complete.tsx
@@ -38,6 +38,7 @@ export const Complete = ({
{commitTxHash}
@@ -49,6 +50,7 @@ export const Complete = ({
{claimTxHash}
diff --git a/apps/token/src/routes/contracts/index.tsx b/apps/token/src/routes/contracts/index.tsx
index 87ce6e9d0..8f4782509 100644
--- a/apps/token/src/routes/contracts/index.tsx
+++ b/apps/token/src/routes/contracts/index.tsx
@@ -14,8 +14,9 @@ const Contracts = () => {
{key}:
{value}
diff --git a/apps/token/src/routes/governance/components/proposal-terms-json/proposal-terms-json.tsx b/apps/token/src/routes/governance/components/proposal-terms-json/proposal-terms-json.tsx
index bb0961c88..d38549dab 100644
--- a/apps/token/src/routes/governance/components/proposal-terms-json/proposal-terms-json.tsx
+++ b/apps/token/src/routes/governance/components/proposal-terms-json/proposal-terms-json.tsx
@@ -10,7 +10,7 @@ export const ProposalTermsJson = ({
const { t } = useTranslation();
return (
- {t('proposalTerms')}
+ {t('proposalTerms')}
);
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 e4adddb4e..c81618da9 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
@@ -37,6 +37,7 @@ export const ProposalVotesTable = ({ proposal }: ProposalVotesTableProps) => {
data-testid="proposal-votes-table"
muted={true}
numerical={true}
+ headingLevel={4}
>
{t('willPass')}
diff --git a/apps/token/src/routes/governance/components/proposals-list/proposals-list.tsx b/apps/token/src/routes/governance/components/proposals-list/proposals-list.tsx
index a279a2da8..53a2eaf22 100644
--- a/apps/token/src/routes/governance/components/proposals-list/proposals-list.tsx
+++ b/apps/token/src/routes/governance/components/proposals-list/proposals-list.tsx
@@ -20,58 +20,67 @@ export const ProposalsList = ({ proposals }: ProposalsListProps) => {
return {t('noProposals')}
;
}
- const renderRow = (proposal: Proposals_proposals) => {
- if (!proposal || !proposal.id) return null;
-
- return (
-
-
- {getProposalName(proposal)}
-
-
-
- {t('state')}
-
-
-
-
-
- {isFuture(new Date(proposal.terms.closingDatetime))
- ? t('closesOn')
- : t('closedOn')}
-
-
- {format(
- new Date(proposal.terms.closingDatetime),
- DATE_FORMAT_DETAILED
- )}
-
-
-
- {isFuture(new Date(proposal.terms.enactmentDatetime))
- ? t('proposedEnactment')
- : t('enactedOn')}
-
-
- {format(
- new Date(proposal.terms.enactmentDatetime),
- DATE_FORMAT_DETAILED
- )}
-
-
-
-
- );
- };
-
return (
<>
- {t('proposedChangesToVegaNetwork')}
- {t('vegaTokenHoldersCanVote')}
- {t('requiredMajorityDescription')}
- {t('proposals')}
- {proposals.map((row) => renderRow(row))}
+ {t('proposedChangesToVegaNetwork')}
+ {t('vegaTokenHoldersCanVote')}
+ {t('requiredMajorityDescription')}
+ {t('proposals')}
+
+ {proposals.map((proposal) => (
+
+ ))}
+
>
);
};
+
+interface ProposalListItemProps {
+ proposal: Proposals_proposals;
+}
+
+const ProposalListItem = ({ proposal }: ProposalListItemProps) => {
+ const { t } = useTranslation();
+ if (!proposal || !proposal.id) return null;
+
+ return (
+
+
+ {getProposalName(proposal)}
+
+
+
+ {t('state')}
+
+
+
+
+
+ {isFuture(new Date(proposal.terms.closingDatetime))
+ ? t('closesOn')
+ : t('closedOn')}
+
+
+ {format(
+ new Date(proposal.terms.closingDatetime),
+ DATE_FORMAT_DETAILED
+ )}
+
+
+
+ {isFuture(new Date(proposal.terms.enactmentDatetime))
+ ? t('proposedEnactment')
+ : t('enactedOn')}
+
+
+ {format(
+ new Date(proposal.terms.enactmentDatetime),
+ DATE_FORMAT_DETAILED
+ )}
+
+
+
+
+ );
+};
diff --git a/apps/token/src/routes/governance/components/vote-details/vote-buttons.tsx b/apps/token/src/routes/governance/components/vote-details/vote-buttons.tsx
index 0cf8cfccc..817abf256 100644
--- a/apps/token/src/routes/governance/components/vote-details/vote-buttons.tsx
+++ b/apps/token/src/routes/governance/components/vote-details/vote-buttons.tsx
@@ -3,10 +3,8 @@ import { format } from 'date-fns';
import * as React from 'react';
import { useTranslation } from 'react-i18next';
-import {
- ProposalState,
- VoteValue,
-} from '../../../../__generated__/globalTypes';
+import { ProposalState } from '../../../../__generated__/globalTypes';
+import { VoteValue } from '../../../../__generated__/globalTypes';
import {
AppStateActionType,
useAppState,
@@ -141,9 +139,8 @@ export const VoteButtons = ({
: 'text-intent-danger';
return (
- {t('youVoted')}{' '}
- {t(`voteState_${voteState}`)}
- {'. '}
+ {t('youVoted')}:{' '}
+ {t(`voteState_${voteState}`)}{' '}
{voteDatetime ? (
{format(voteDatetime, DATE_FORMAT_LONG)}.
) : null}
@@ -167,17 +164,11 @@ export const VoteButtons = ({
}
return (
-
-