1import Maybe from 'folktale/maybe';
2import React from 'react';
3import * as need from '../lib/need';
4import { H1, H3, P, Warning, Anchor } from '../components/old/Base';
5import { Button } from '../components/old/Base';
7import { ROUTE_NAMES } from '../lib/routeNames';
8import { useHistory } from '../store/history';
9import { BRIDGE_ERROR, renderTxnError } from '../lib/error';
10import { NETWORK_TYPES } from '../lib/network';
11import { useNetwork } from '../store/network';
12import { useTxnCursor } from '../store/txnCursor';
13import View from 'components/View';
14import { Grid } from 'indigo-react';
16class Success extends React.Component {
27 const nextDot = { '.': '..', '..': '...', '...': '.' };
29 const interval = setInterval(() => {
30 this.setState(({ pending }) => ({ pending: nextDot[pending] }));
32 this.setState({ interval: interval });
35 componentWillUnmount() {
36 clearInterval(this.state.interval);
40 const { props, state } = this;
41 const { networkType, hash } = props;
42 const { pending } = state;
45 networkType === NETWORK_TYPES.ROPSTEN ||
46 networkType === NETWORK_TYPES.MAINNET;
49 networkType === NETWORK_TYPES.ROPSTEN
50 ? 'ropsten.etherscan.io'
55 ? 'If you’d like to keep track of it, click the Etherscan link below.'
59 esvisible === false ? null : (
61 className={'mb-4 mt-1'}
64 href={`https://${esdomain}/tx/${hash}`}>
65 {'View on Etherscan ↗'}
69 const confirmations = 1;
71 const requiredConfirmations = 1;
74 confirmations < requiredConfirmations
76 : `Confirmed! (x${confirmations} confirmations)!`;
81 <H1>{'Your Transaction was Sent'}</H1>
84 {`We sent your transaction to the chain. It can take some time to
85 execute, especially if the network is busy. ${esmessage}`}
88 <H3>{'Transaction Hash'}</H3>
91 <H3>{'Transaction Status'}</H3>
100const Failure = props => (
106 <H3>{'There was an error sending your transaction.'}</H3>
107 {renderTxnError(props.web3, props.message)}
113function SentTransaction(props) {
114 const history = useHistory();
115 const { web3, networkType } = useNetwork();
116 const { txnCursor } = useTxnCursor();
118 const promptKeyfile = history.data && history.data.promptKeyfile;
120 const w3 = need.web3(web3);
122 const result = txnCursor.matchWith({
124 throw new Error(BRIDGE_ERROR.MISSING_TXN);
126 Just: res => res.value,
129 const body = result.matchWith({
130 Error: message => <Failure web3={w3} message={message.value} />,
131 Ok: hash => <Success hash={hash.value} networkType={networkType} />,
156 onClick={() => history.popAndPush(ROUTE_NAMES.GEN_KEYFILE)}>
157 {'Download Keyfile →'}
173export 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