import React from 'react'; import { Link } from 'react-router-dom'; import translate from 'translations'; import { NewTabLink } from 'components/ui'; import { BlockExplorerConfig } from 'types/network'; import { etherChainExplorerInst } from 'config/data'; export interface TransactionSucceededProps { txHash: string; blockExplorer?: BlockExplorerConfig; } const TransactionSucceeded = ({ txHash, blockExplorer }: TransactionSucceededProps) => { let verifyBtn: React.ReactElement | undefined; let altVerifyBtn: React.ReactElement | undefined; if (blockExplorer) { verifyBtn = ( {translate('VERIFY_TX', { $block_explorer: blockExplorer.name })} ); } // TODO: In the future, we'll want to refactor staticNetworks so that multiple blockexplorers can be configured per network. // This requires a large refactor, so for now we'll hard-code the etherchain link when etherscan is shown to verify your transaction if (blockExplorer && blockExplorer.origin === 'https://etherscan.io') { altVerifyBtn = ( {translate('VERIFY_TX', { $block_explorer: etherChainExplorerInst.name })} ); } return (

{translate('SUCCESS_3')} {txHash}

{verifyBtn} {altVerifyBtn} {translate('NAV_CHECKTXSTATUS')}
); }; export default TransactionSucceeded;