vega-frontend-monorepo/apps/token/src/routes/claim/complete.tsx
botond ecda46caa5
Feat/6 Network Switcher (#502)
* feat: add network-switcher lib

* feat: add env variables for some deployed app urls

* feat: add network processing to environment hoook

* refactor: network handling

* refactor: remove dialog from provider and add env setter

* feat: add network switcher dialog to the trading app

* refactor: add network redirect to dialog connect callback

* fix: lint

* fix: jsonify env variable for possible networks

* fix: add formatter file

* fix: assign correct global state to network swicther

* feat: add network-switcher lib

* feat: add env variables for some deployed app urls

* feat: add network processing to environment hoook

* refactor: network handling

* refactor: remove dialog from provider and add env setter

* feat: add network switcher dialog to the trading app

* refactor: add network redirect to dialog connect callback

* fix: lint

* fix: jsonify env variable for possible networks

* fix: add formatter file

* fix: assign correct global state to network swicther

* fix: failing tests from UI changes

* fix: lint

* fix: lint

Co-authored-by: Joe <joe@vega.xyz>
Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-06-10 10:15:38 +01:00

65 lines
1.7 KiB
TypeScript

import { Callout, Intent, Link, Button } from '@vegaprotocol/ui-toolkit';
import { useEnvironment } from '@vegaprotocol/network-switcher';
import { Trans, useTranslation } from 'react-i18next';
import { Link as RouteLink } from 'react-router-dom';
import type { BigNumber } from '../../lib/bignumber';
import { formatNumber } from '../../lib/format-number';
import { Routes } from '../router-config';
export const Complete = ({
address,
balanceFormatted,
commitTxHash,
claimTxHash,
}: {
address: string;
balanceFormatted: BigNumber;
commitTxHash: string | null;
claimTxHash: string | null;
}) => {
const { ETHERSCAN_URL } = useEnvironment();
const { t } = useTranslation();
return (
<Callout intent={Intent.Success} title="Claim complete" iconName="tick">
<p>
<Trans
i18nKey="claimCompleteMessage"
values={{
address,
balance: formatNumber(balanceFormatted),
}}
/>
</p>
{commitTxHash && (
<p style={{ margin: 0 }}>
{t('Link transaction')}:{' '}
<Link
title={t('View transaction on Etherscan')}
href={`${ETHERSCAN_URL}/tx/${commitTxHash}`}
target="_blank"
>
{commitTxHash}
</Link>
</p>
)}
{claimTxHash && (
<p>
{t('Claim transaction')}:{' '}
<Link
title={t('View transaction on Etherscan')}
href={`${ETHERSCAN_URL}/tx/${claimTxHash}`}
target="_blank"
>
{claimTxHash}
</Link>
</p>
)}
<RouteLink to={Routes.VESTING}>
<Button className="fill">{t('Check your vesting VEGA tokens')}</Button>
</RouteLink>
</Callout>
);
};