1import React from 'react';
2import * as need from '../lib/need';
3import { H1, H3, P, Warning, Anchor } from '../components/old/Base';
4import { Button } from '../components/old/Base';
6import { ROUTE_NAMES } from '../lib/routeNames';
7import { useHistory } from '../store/history';
8import { BRIDGE_ERROR, renderTxnError } from '../lib/error';
9import { NETWORK_TYPES } from '../lib/network';
10import { useNetwork } from '../store/network';
11import { useTxnCursor } from '../store/txnCursor';
12import View from 'components/View';
13import { Grid } from 'indigo-react';
15class Success extends React.Component {
26 const nextDot = { '.': '..', '..': '...', '...': '.' };
28 const interval = setInterval(() => {
29 this.setState(({ pending }) => ({ pending: nextDot[pending] }));
31 this.setState({ interval: interval });
34 componentWillUnmount() {
35 clearInterval(this.state.interval);
39 const { props, state } = this;
40 const { networkType, hash } = props;
41 const { pending } = state;
44 networkType === NETWORK_TYPES.ROPSTEN ||
45 networkType === NETWORK_TYPES.MAINNET;
48 networkType === NETWORK_TYPES.ROPSTEN
49 ? 'ropsten.etherscan.io'
54 ? 'If you’d like to keep track of it, click the Etherscan link below.'
58 esvisible === false ? null : (
60 className={'mb-4 mt-1'}
63 href={`https://${esdomain}/tx/${hash}`}>
64 {'View on Etherscan ↗'}
68 const confirmations = 1;
70 const requiredConfirmations = 1;
73 confirmations < requiredConfirmations
75 : `Confirmed! (x${confirmations} confirmations)!`;
80 <H1>{'Your Transaction was Sent'}</H1>
83 {`We sent your transaction to the chain. It can take some time to
84 execute, especially if the network is busy. ${esmessage}`}
87 <H3>{'Transaction Hash'}</H3>
90 <H3>{'Transaction Status'}</H3>
99const Failure = props => (
105 <H3>{'There was an error sending your transaction.'}</H3>
106 {renderTxnError(props.web3, props.message)}
112function SentTransaction(props) {
113 const history = useHistory();
114 const { web3, networkType } = useNetwork();
115 const { txnCursor } = useTxnCursor();
117 const promptKeyfile = history.data && history.data.promptKeyfile;
119 const w3 = need.web3(web3);
121 const result = txnCursor.matchWith({
123 throw new Error(BRIDGE_ERROR.MISSING_TXN);
125 Just: res => res.value,
128 const body = result.matchWith({
129 Error: message => <Failure web3={w3} message={message.value} />,
130 Ok: hash => <Success hash={hash.value} networkType={networkType} />,
155 onClick={() => history.popAndPush(ROUTE_NAMES.GEN_KEYFILE)}>
156 {'Download Keyfile →'}
172export default SentTransaction;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list