forked from terra-money/bridge-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCopyTokenAddress.tsx
50 lines (44 loc) · 1.41 KB
/
CopyTokenAddress.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { ReactElement } from 'react'
import { useRecoilValue } from 'recoil'
import SendStore from 'store/SendStore'
import { Text, View, Row, CopyTokenAddressButton } from 'components'
import useNetwork from 'hooks/useNetwork'
const CopyTokenAddress = (): ReactElement => {
const asset = useRecoilValue(SendStore.asset)
const toBlockChain = useRecoilValue(SendStore.toBlockChain)
const fromBlockChain = useRecoilValue(SendStore.fromBlockChain)
const { fromTokenAddress, toTokenAddress } = useNetwork()
return (
<>
{asset && (fromTokenAddress || toTokenAddress) && (
<Row
style={{
alignItems: 'center',
paddingTop: 8,
}}
>
<Text
style={{ color: '#737373', fontSize: 11 }}
>{`Copy ${asset.symbol} token address`}</Text>
{fromTokenAddress && (
<View style={{ paddingLeft: 4 }}>
<CopyTokenAddressButton
blockChain={fromBlockChain}
value={fromTokenAddress}
/>
</View>
)}
{toTokenAddress && toBlockChain !== fromBlockChain && (
<View style={{ paddingLeft: 4 }}>
<CopyTokenAddressButton
blockChain={toBlockChain}
value={toTokenAddress}
/>
</View>
)}
</Row>
)}
</>
)
}
export default CopyTokenAddress