@@ -4,7 +4,36 @@ import { Button } from '../components/Base'
44
55import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
66
7−const Success = (props) =>
7+import { NETWORK_NAMES } from '../lib/network'
8+
9+const Success = (props) => {
10+
11+ const esvisible =
12+ props.networkType === NETWORK_NAMES.ROPSTEN ||
13+ props.networkType === NETWORK_NAMES.MAINNET
14+
15+ const esdomain =
16+ props.networkType === NETWORK_NAMES.ROPSTEN
17+ ? "ropsten.etherscan.io"
18+ : "etherscan.io"
19+
20+ const esmessage =
21+ esvisible === true
22+ ? "If you’d like to keep track of it, click the Etherscan link below."
23+ : ''
24+
25+ const esanchor =
26+ esvisible === false
27+ ? <div />
28+ : <Anchor
29+ className={'mb-4 mt-1'}
30+ prop-size={'sm'}
31+ target={'_blank'}
32+ href={`https://${esdomain}/tx/${props.hash}`}>
33+ {'View on Etherscan ↗'}
34+ </Anchor>
35+
36+ return (
837 <Row>
938 <Col>
1039 <H1>{ 'Your Transaction was Sent' }</H1>
@@ -12,8 +41,7 @@ const Success = (props) =>
1241 <P>
1342 {
1443 `We sent your transaction to the chain. It can take some time to
15− execute, especially if the network is busy. If you’d like to keep
16− track of it, click the Etherscan link below.`
44+ execute, especially if the network is busy. ${esmessage}`
1745 }
1846 </P>
1947
@@ -21,15 +49,13 @@ const Success = (props) =>
2149 <P>
2250 { props.hash }
2351 </P>
24− <Anchor
25− className={'mb-4 mt-1'}
26− prop-size={'sm'}
27− target={'_blank'}
28− href={`https://etherscan.io/tx/${props.hash}`}>
29− {'View on Etherscan ↗'}
30− </Anchor>
52+
53+ { esanchor }
54+
3155 </Col>
3256 </Row>
57+ )
58+}
3359
3460const Failure = (props) =>
3561
@@ -50,7 +76,7 @@ const Failure = (props) =>
5076 </Row>
5177
5278const SentTransaction = (props) => {
53− const { web3, txnCursor, popRoute } = props
79+ const { web3, txnCursor, networkType, popRoute } = props
5480 const { setPointCursor, pointCursor } = props
5581
5682 const w3 = web3.matchWith({
@@ -65,7 +91,11 @@ const SentTransaction = (props) => {
6591
6692 const body = result.matchWith({
6793 Error: message => <Failure web3={ w3 } message={ message.value } />,
68− Ok: txn => <Success hash={ txn.value.transactionHash } />
94+ Ok: txn =>
95+ <Success
96+ hash={ txn.value.transactionHash }
97+ networkType={ networkType }
98+ />
6999 })
70100
71101 const ok =