2022-06-01 00:30:02 +00:00
|
|
|
import { Callout, Intent, Link, Button } from '@vegaprotocol/ui-toolkit';
|
|
|
|
import { useEnvironment } from '@vegaprotocol/react-helpers';
|
2022-04-20 19:37:44 +00:00
|
|
|
import { Trans, useTranslation } from 'react-i18next';
|
2022-06-01 00:30:02 +00:00
|
|
|
import { Link as RouteLink } from 'react-router-dom';
|
2022-04-20 19:37:44 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}) => {
|
2022-06-01 00:30:02 +00:00
|
|
|
const { ETHERSCAN_URL } = useEnvironment();
|
2022-04-20 19:37:44 +00:00
|
|
|
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')}:{' '}
|
2022-06-01 00:30:02 +00:00
|
|
|
<Link
|
|
|
|
title={t('View transaction on Etherscan')}
|
|
|
|
href={`${ETHERSCAN_URL}/tx/${commitTxHash}`}
|
2022-06-07 18:24:43 +00:00
|
|
|
target="_blank"
|
2022-06-01 00:30:02 +00:00
|
|
|
>
|
|
|
|
{commitTxHash}
|
|
|
|
</Link>
|
2022-04-20 19:37:44 +00:00
|
|
|
</p>
|
|
|
|
)}
|
|
|
|
{claimTxHash && (
|
|
|
|
<p>
|
|
|
|
{t('Claim transaction')}:{' '}
|
2022-06-01 00:30:02 +00:00
|
|
|
<Link
|
|
|
|
title={t('View transaction on Etherscan')}
|
|
|
|
href={`${ETHERSCAN_URL}/tx/${claimTxHash}`}
|
2022-06-07 18:24:43 +00:00
|
|
|
target="_blank"
|
2022-06-01 00:30:02 +00:00
|
|
|
>
|
|
|
|
{claimTxHash}
|
|
|
|
</Link>
|
2022-04-20 19:37:44 +00:00
|
|
|
</p>
|
|
|
|
)}
|
2022-06-01 00:30:02 +00:00
|
|
|
<RouteLink to={Routes.VESTING}>
|
2022-04-20 19:37:44 +00:00
|
|
|
<Button className="fill">{t('Check your vesting VEGA tokens')}</Button>
|
2022-06-01 00:30:02 +00:00
|
|
|
</RouteLink>
|
2022-04-20 19:37:44 +00:00
|
|
|
</Callout>
|
|
|
|
);
|
|
|
|
};
|