|
|
|
@ -2,7 +2,6 @@
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { QRCode } from 'react-qr-svg';
|
|
|
|
|
import styled from 'styled-components';
|
|
|
|
|
import media from 'styled-media-query';
|
|
|
|
|
|
|
|
|
|
import Title from 'views/Wallet/components/Title';
|
|
|
|
|
import Button from 'components/Button';
|
|
|
|
@ -20,7 +19,7 @@ import VerifyAddressTooltip from '../components/VerifyAddressTooltip';
|
|
|
|
|
import type { Props } from './Container';
|
|
|
|
|
|
|
|
|
|
const Label = styled.div`
|
|
|
|
|
padding: 25px 0 5px 0;
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
color: ${colors.TEXT_SECONDARY};
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
@ -43,14 +42,17 @@ const ShowAddressButton = styled(Button)`
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 40px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
align-self: flex-end;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
|
|
|
|
|
${media.lessThan('795px')`
|
|
|
|
|
@media screen and (max-width: 795px) {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
`}
|
|
|
|
|
align-self: auto;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const ShowAddressIcon = styled(Icon)`
|
|
|
|
@ -63,23 +65,24 @@ const EyeButton = styled(Button)`
|
|
|
|
|
z-index: 10001;
|
|
|
|
|
padding: 0;
|
|
|
|
|
width: 30px;
|
|
|
|
|
background: white;
|
|
|
|
|
background: transparent;
|
|
|
|
|
top: 5px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 10px;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background: white;
|
|
|
|
|
background: transparent;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const Row = styled.div`
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding-bottom: 28px;
|
|
|
|
|
|
|
|
|
|
${media.lessThan('795px')`
|
|
|
|
|
@media screen and (max-width: 795px) {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
`}
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const QrWrapper = styled.div`
|
|
|
|
@ -113,66 +116,68 @@ const AccountReceive = (props: Props) => {
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Content>
|
|
|
|
|
<Title>Receive Ethereum or tokens</Title>
|
|
|
|
|
<AddressWrapper isShowingQrCode={addressVerified || addressUnverified}>
|
|
|
|
|
<Label>Address</Label>
|
|
|
|
|
<Row>
|
|
|
|
|
<Input
|
|
|
|
|
type="text"
|
|
|
|
|
readOnly
|
|
|
|
|
autoSelect
|
|
|
|
|
value={address}
|
|
|
|
|
isPartiallyHidden={isAddressHidden}
|
|
|
|
|
trezorAction={isAddressVerifying ? (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Icon
|
|
|
|
|
icon={ICONS.T1}
|
|
|
|
|
color={colors.WHITE}
|
|
|
|
|
/>
|
|
|
|
|
Check address on your Trezor
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
) : null}
|
|
|
|
|
icon={((addressVerified || addressUnverified) && !isAddressVerifying) && (
|
|
|
|
|
<Tooltip
|
|
|
|
|
placement="left"
|
|
|
|
|
content={(
|
|
|
|
|
<VerifyAddressTooltip
|
|
|
|
|
isConnected={device.connected}
|
|
|
|
|
isAvailable={device.available}
|
|
|
|
|
addressUnverified={addressUnverified}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<EyeButton onClick={() => props.showAddress(account.addressPath)}>
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Title>Receive Ethereum or tokens</Title>
|
|
|
|
|
<AddressWrapper isShowingQrCode={addressVerified || addressUnverified}>
|
|
|
|
|
<Row>
|
|
|
|
|
<Input
|
|
|
|
|
type="text"
|
|
|
|
|
readOnly
|
|
|
|
|
autoSelect
|
|
|
|
|
topLabel="Address"
|
|
|
|
|
value={address}
|
|
|
|
|
isPartiallyHidden={isAddressHidden}
|
|
|
|
|
trezorAction={isAddressVerifying ? (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Icon
|
|
|
|
|
icon={addressUnverified ? ICONS.EYE_CROSSED : ICONS.EYE}
|
|
|
|
|
color={addressUnverified ? colors.ERROR_PRIMARY : colors.TEXT_PRIMARY}
|
|
|
|
|
icon={ICONS.T1}
|
|
|
|
|
color={colors.WHITE}
|
|
|
|
|
/>
|
|
|
|
|
</EyeButton>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
Check address on your Trezor
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
) : null}
|
|
|
|
|
icon={((addressVerified || addressUnverified) && !isAddressVerifying) && (
|
|
|
|
|
<Tooltip
|
|
|
|
|
placement="left"
|
|
|
|
|
content={(
|
|
|
|
|
<VerifyAddressTooltip
|
|
|
|
|
isConnected={device.connected}
|
|
|
|
|
isAvailable={device.available}
|
|
|
|
|
addressUnverified={addressUnverified}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<EyeButton onClick={() => props.showAddress(account.addressPath)}>
|
|
|
|
|
<Icon
|
|
|
|
|
icon={addressUnverified ? ICONS.EYE_CROSSED : ICONS.EYE}
|
|
|
|
|
color={addressUnverified ? colors.ERROR_PRIMARY : colors.TEXT_PRIMARY}
|
|
|
|
|
/>
|
|
|
|
|
</EyeButton>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
{!(addressVerified || addressUnverified) && (
|
|
|
|
|
<ShowAddressButton onClick={() => props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}>
|
|
|
|
|
<ShowAddressIcon icon={ICONS.EYE} color={colors.WHITE} />Show full address
|
|
|
|
|
</ShowAddressButton>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
{!(addressVerified || addressUnverified) && (
|
|
|
|
|
<ShowAddressButton onClick={() => props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}>
|
|
|
|
|
<ShowAddressIcon icon={ICONS.EYE} color={colors.WHITE} />Show full address
|
|
|
|
|
</ShowAddressButton>
|
|
|
|
|
</Row>
|
|
|
|
|
{(addressVerified || addressUnverified) && !isAddressVerifying && (
|
|
|
|
|
<QrWrapper>
|
|
|
|
|
<Label>QR code</Label>
|
|
|
|
|
<StyledQRCode
|
|
|
|
|
bgColor="#FFFFFF"
|
|
|
|
|
fgColor="#000000"
|
|
|
|
|
level="Q"
|
|
|
|
|
style={{ width: 150 }}
|
|
|
|
|
value={account.address}
|
|
|
|
|
/>
|
|
|
|
|
</QrWrapper>
|
|
|
|
|
)}
|
|
|
|
|
</Row>
|
|
|
|
|
{(addressVerified || addressUnverified) && !isAddressVerifying && (
|
|
|
|
|
<QrWrapper>
|
|
|
|
|
<Label>QR code</Label>
|
|
|
|
|
<StyledQRCode
|
|
|
|
|
bgColor="#FFFFFF"
|
|
|
|
|
fgColor="#000000"
|
|
|
|
|
level="Q"
|
|
|
|
|
style={{ width: 150 }}
|
|
|
|
|
value={account.address}
|
|
|
|
|
/>
|
|
|
|
|
</QrWrapper>
|
|
|
|
|
)}
|
|
|
|
|
</AddressWrapper>
|
|
|
|
|
</AddressWrapper>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
</Content>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default AccountReceive;
|
|
|
|
|
export default AccountReceive;
|