@@ -1,3 +1,4 @@
1+import Maybe from 'folktale/maybe'
12import React from 'react'
23import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base'
34import { Button } from '../components/Base'
@@ -6,14 +7,17 @@ import { ROUTE_NAMES } from '../lib/router'
67import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
78import { NETWORK_NAMES } from '../lib/network'
89
10+
911const Success = (props) => {
1012
13+ const { networkType, hash, txnConfirmations } = props
14+
1115 const esvisible =
12− props.networkType === NETWORK_NAMES.ROPSTEN ||
13− props.networkType === NETWORK_NAMES.MAINNET
16+ networkType === NETWORK_NAMES.ROPSTEN ||
17+ networkType === NETWORK_NAMES.MAINNET
1418
1519 const esdomain =
16− props.networkType === NETWORK_NAMES.ROPSTEN
20+ networkType === NETWORK_NAMES.ROPSTEN
1721 ? "ropsten.etherscan.io"
1822 : "etherscan.io"
1923
@@ -29,10 +33,16 @@ const Success = (props) => {
2933 className={'mb-4 mt-1'}
3034 prop-size={'sm'}
3135 target={'_blank'}
32− href={`https://${esdomain}/tx/${props.hash}`}>
36+ href={`https://${esdomain}/tx/${hash}`}>
3337 {'View on Etherscan ↗'}
3438 </Anchor>
3539
40+ const confirmations = Maybe.fromNullable(txnConfirmations[hash]).getOrElse(0)
41+
42+ const requiredConfirmations = 1
43+
44+ const status = confirmations < requiredConfirmations ? 'Pending...' : `Confirmed x${confirmations}!`
45+
3646 return (
3747 <Row>
3848 <Col>
@@ -47,10 +57,17 @@ const Success = (props) => {
4757
4858 <H3>{ 'Transaction Hash' }</H3>
4959 <P>
50− { props.hash }
60+ { hash }
61+ </P>
62+
63+ <H3>{ 'Transaction Status' }</H3>
64+ <P>
65+ <div>{ status }</div>
66+ <div>{ esanchor }</div>
67+ </P>
68+ <P>
5169 </P>
5270
53− { esanchor }
5471
5572 </Col>
5673 </Row>
@@ -76,7 +93,7 @@ const Failure = (props) =>
7693 </Row>
7794
7895const SentTransaction = (props) => {
79− const { web3, txnHashCursor, networkType, popRoute, pushRoute } = props
96+ const { web3, txnHashCursor, networkType, popRoute, pushRoute, txnConfirmations} = props
8097 const { setPointCursor, pointCursor } = props
8198
8299 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
@@ -97,6 +114,7 @@ const SentTransaction = (props) => {
97114 <Success
98115 hash={ hash.value }
99116 networkType={ networkType }
117+ txnConfirmations={ txnConfirmations }
100118 />
101119 })
102120