2017-08-31 04:00:31 +00:00
|
|
|
import React from 'react';
|
2018-03-05 18:58:53 +00:00
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import translate from 'translations';
|
|
|
|
import { NewTabLink } from 'components/ui';
|
2018-02-12 20:43:07 +00:00
|
|
|
import { BlockExplorerConfig } from 'types/network';
|
2017-09-20 00:47:08 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export interface TransactionSucceededProps {
|
|
|
|
txHash: string;
|
2018-03-05 18:58:53 +00:00
|
|
|
blockExplorer?: BlockExplorerConfig;
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
2017-08-31 04:00:31 +00:00
|
|
|
|
2017-12-18 23:29:26 +00:00
|
|
|
const TransactionSucceeded = ({ txHash, blockExplorer }: TransactionSucceededProps) => {
|
2018-03-05 18:58:53 +00:00
|
|
|
let verifyBtn: React.ReactElement<string> | undefined;
|
|
|
|
if (blockExplorer) {
|
|
|
|
verifyBtn = (
|
|
|
|
<NewTabLink className="btn btn-xs" href={blockExplorer.txUrl(txHash)}>
|
2018-03-22 03:50:25 +00:00
|
|
|
{translate('VERIFY_TX', { $block_explorer: blockExplorer.name })}
|
2018-03-05 18:58:53 +00:00
|
|
|
</NewTabLink>
|
|
|
|
);
|
|
|
|
}
|
2017-08-31 04:00:31 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2018-03-05 18:58:53 +00:00
|
|
|
<p>
|
|
|
|
{translate('SUCCESS_3')} {txHash}
|
|
|
|
</p>
|
|
|
|
{verifyBtn}
|
|
|
|
<Link to={`/tx-status?txHash=${txHash}`} className="btn btn-xs">
|
2018-03-26 17:48:41 +00:00
|
|
|
{translate('NAV_CHECKTXSTATUS')}
|
2018-03-05 18:58:53 +00:00
|
|
|
</Link>
|
2017-08-31 04:00:31 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TransactionSucceeded;
|