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 { useTxnConfirmations } from '../store/txnConfirmations';
12import { useNetwork } from '../store/network';
13import { useTxnCursor } from '../store/txnCursor';
14import View from 'components/View';
15import { Grid } from 'indigo-react';
17class Success extends React.Component {
28 const nextDot = { '.': '..', '..': '...', '...': '.' };
30 const interval = setInterval(() => {
31 this.setState(({ pending }) => ({ pending: nextDot[pending] }));
33 this.setState({ interval: interval });
36 componentWillUnmount() {
37 clearInterval(this.state.interval);
41 const { props, state } = this;
42 const { networkType, hash, txnConfirmations } = props;
43 const { pending } = state;
46 networkType === NETWORK_TYPES.ROPSTEN ||
47 networkType === NETWORK_TYPES.MAINNET;
50 networkType === NETWORK_TYPES.ROPSTEN
51 ? 'ropsten.etherscan.io'
56 ? 'If you’d like to keep track of it, click the Etherscan link below.'
60 esvisible === false ? null : (
62 className={'mb-4 mt-1'}
65 href={`https://${esdomain}/tx/${hash}`}>
66 {'View on Etherscan ↗'}
70 const confirmations = Maybe.fromNullable(txnConfirmations[hash]).getOrElse(
74 const requiredConfirmations = 1;
77 confirmations < requiredConfirmations
79 : `Confirmed! (x${confirmations} confirmations)!`;
84 <H1>{'Your Transaction was Sent'}</H1>
87 {`We sent your transaction to the chain. It can take some time to
88 execute, especially if the network is busy. ${esmessage}`}
91 <H3>{'Transaction Hash'}</H3>
94 <H3>{'Transaction Status'}</H3>
103const Failure = props => (
109 <H3>{'There was an error sending your transaction.'}</H3>
110 {renderTxnError(props.web3, props.message)}
116function SentTransaction(props) {
117 const history = useHistory();
118 const { txnConfirmations } = useTxnConfirmations();
119 const { web3, networkType } = useNetwork();
120 const { txnCursor } = useTxnCursor();
122 const promptKeyfile = history.data && history.data.promptKeyfile;
124 const w3 = need.web3(web3);
126 const result = txnCursor.matchWith({
128 throw BRIDGE_ERROR.MISSING_TXN;
130 Just: res => res.value,
133 const body = result.matchWith({
134 Error: message => <Failure web3={w3} message={message.value} />,
138 networkType={networkType}
139 txnConfirmations={txnConfirmations}
166 onClick={() => history.popAndPush(ROUTE_NAMES.GEN_KEYFILE)}>
167 {'Download Keyfile →'}
183export 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