@@ -1,3 +1,4 @@
1+import Maybe from 'folktale/maybe'
1import React from 'react'
2import React from 'react'
2import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base'
3import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base'
3import { Button } from '../components/Base'
4import { Button } from '../components/Base'
@@ -6,55 +7,100 @@ import { ROUTE_NAMES } from '../lib/router'
6import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
7import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
7import { NETWORK_NAMES } from '../lib/network'
8import { NETWORK_NAMES } from '../lib/network'
9−const Success = (props) => {
12− props.networkType === NETWORK_NAMES.ROPSTEN ||
13− props.networkType === NETWORK_NAMES.MAINNET
16− props.networkType === NETWORK_NAMES.ROPSTEN
17− ? "ropsten.etherscan.io"
22− ? "If you’d like to keep track of it, click the Etherscan link below."
29− className={'mb-4 mt-1'}
32− href={`https://${esdomain}/tx/${props.hash}`}>
33− {'View on Etherscan ↗'}
36− return (
11+class Success extends React.Component {
38− <Col>
13+ constructor(props) {
39− <H1>{ 'Your Transaction was Sent' }</H1>
14+ super(props)
22+ componentDidMount() {
23+ const nextDot = {'.': '..',
27+ const interval = setInterval(() => {
28+ this.setState(({ pending }) => ({pending: nextDot[pending]}))
30+ this.setState({interval: interval})
33+ componentWillUnmount() {
34+ clearInterval(this.state.interval)
39+ const { props, state } = this
40+ const { networkType, hash, txnConfirmations } = props
41+ const { pending } = state
44+ networkType === NETWORK_NAMES.ROPSTEN ||
45+ networkType === NETWORK_NAMES.MAINNET
48+ networkType === NETWORK_NAMES.ROPSTEN
49+ ? "ropsten.etherscan.io"
54+ ? "If you’d like to keep track of it, click the Etherscan link below."
61+ className={'mb-4 mt-1'}
64+ href={`https://${esdomain}/tx/${hash}`}>
65+ {'View on Etherscan ↗'}
68+ const confirmations = Maybe.fromNullable(txnConfirmations[hash]).getOrElse(0)
70+ const requiredConfirmations = 1
72+ const status = confirmations < requiredConfirmations ?
73+ `Pending${pending}` : `Confirmed! (x${confirmations} confirmations)!`
78+ <H1>{ 'Your Transaction was Sent' }</H1>
43− `We sent your transaction to the chain. It can take some time to
82+ `We sent your transaction to the chain. It can take some time to
44 execute, especially if the network is busy. ${esmessage}`
83 execute, especially if the network is busy. ${esmessage}`
48− <H3>{ 'Transaction Hash' }</H3>
87+ <H3>{ 'Transaction Hash' }</H3>
50− { props.hash }
89+ { hash }
92+ <H3>{ 'Transaction Status' }</H3>
53− { esanchor }
97+ { esanchor }
60const Failure = (props) =>
106const Failure = (props) =>
@@ -76,7 +122,7 @@ const Failure = (props) =>
78const SentTransaction = (props) => {
124const SentTransaction = (props) => {
79− const { web3, txnHashCursor, networkType, popRoute, pushRoute } = props
125+ const { web3, txnHashCursor, networkType, popRoute, pushRoute, txnConfirmations} = props
80 const { setPointCursor, pointCursor } = props
126 const { setPointCursor, pointCursor } = props
82 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
128 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
@@ -97,6 +143,7 @@ const SentTransaction = (props) => {
98 hash={ hash.value }
144 hash={ hash.value }
99 networkType={ networkType }
145 networkType={ networkType }
146+ txnConfirmations={ txnConfirmations }