11import React , { useState , useCallback , useMemo } from 'react'
22import { RouteComponentProps } from 'react-router-dom'
33import { useTranslation } from 'react-i18next'
4- import { Stack , Text , TextField , TooltipHost , Modal } from 'office-ui-fabric-react'
4+ import { Stack , Text , TextField , TooltipHost , Modal , FontSizes } from 'office-ui-fabric-react'
55
66import { StateWithDispatch } from 'states/stateProvider/reducer'
77import QRCode from 'widgets/QRCode'
88import { Copy } from 'grommet-icons'
99
10- declare global {
11- interface Window {
12- clipboard : any
13- }
14- }
15-
1610const Receive = ( {
1711 wallet : { addresses = [ ] } ,
1812 match : { params } ,
@@ -37,24 +31,35 @@ const Receive = ({
3731 }
3832
3933 return (
40- < Stack tokens = { { childrenGap : 15 } } horizontalAlign = "center" >
41- < Stack onClick = { ( ) => setShowLargeQRCode ( true ) } style = { { alignSelf : 'center' } } >
42- < QRCode value = { accountAddress } size = { 256 } />
43- </ Stack >
44- < Stack styles = { { root : { maxWidth : 500 } } } >
45- < TooltipHost content = { t ( 'receive.click-to-copy' ) } calloutProps = { { gapSpace : 0 } } >
46- < Stack horizontal horizontalAlign = "stretch" tokens = { { childrenGap : 15 } } >
47- < TextField
48- styles = { { root : { flex : 1 } } }
49- readOnly
50- placeholder = { accountAddress }
51- onClick = { copyAddress }
52- description = { t ( 'receive.prompt' ) }
53- />
54- < Copy onClick = { copyAddress } />
55- </ Stack >
56- </ TooltipHost >
34+ < >
35+ < Stack horizontal tokens = { { childrenGap : 40 } } padding = "20px 0 0 0 " horizontalAlign = "space-between" >
36+ < Stack styles = { { root : { flex : 1 } } } >
37+ < TooltipHost content = { t ( 'receive.click-to-copy' ) } calloutProps = { { gapSpace : 0 } } >
38+ < Stack horizontal horizontalAlign = "stretch" tokens = { { childrenGap : 15 } } >
39+ < TextField
40+ styles = { {
41+ root : {
42+ flex : 1 ,
43+ } ,
44+ description : {
45+ fontSize : FontSizes . medium ,
46+ } ,
47+ } }
48+ readOnly
49+ placeholder = { accountAddress }
50+ onClick = { copyAddress }
51+ description = { t ( 'receive.prompt' ) }
52+ />
53+ < Copy onClick = { copyAddress } />
54+ </ Stack >
55+ </ TooltipHost >
56+ </ Stack >
57+
58+ < Stack style = { { alignSelf : 'center' } } >
59+ < QRCode value = { accountAddress } onQRCodeClick = { ( ) => setShowLargeQRCode ( true ) } size = { 256 } exportable />
60+ </ Stack >
5761 </ Stack >
62+
5863 < Modal isOpen = { showLargeQRCode } onDismiss = { ( ) => setShowLargeQRCode ( false ) } >
5964 < Stack
6065 styles = { {
@@ -77,7 +82,7 @@ const Receive = ({
7782 < QRCode value = { accountAddress } size = { 400 } />
7883 </ Stack >
7984 </ Modal >
80- </ Stack >
85+ </ >
8186 )
8287}
8388
0 commit comments