mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-02 11:21:11 +00:00
Make initial layout responsive
This commit is contained in:
parent
5aaadade36
commit
d682833aa3
@ -79,6 +79,7 @@ const Overlay = styled.div`
|
||||
${props => props.isPartiallyHidden && css`
|
||||
bottom: 0;
|
||||
border: 1px solid ${colors.DIVIDER};
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -2,6 +2,7 @@
|
||||
import React from 'react';
|
||||
import { QRCode } from 'react-qr-svg';
|
||||
import styled, { css } from 'styled-components';
|
||||
import media from 'styled-media-query';
|
||||
|
||||
import { H2 } from 'components/Heading';
|
||||
import Button from 'components/Button';
|
||||
@ -25,11 +26,9 @@ const Label = styled.div`
|
||||
`;
|
||||
|
||||
const AddressWrapper = styled.div`
|
||||
position: relative;
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: ${props => (props.isShowingQrCode ? 'column' : 'row')};
|
||||
flex-direction: row;
|
||||
`;
|
||||
|
||||
const StyledQRCode = styled(QRCode)`
|
||||
@ -78,15 +77,19 @@ const AddressInfoText = styled.div`
|
||||
`;
|
||||
|
||||
const ShowAddressButton = styled(Button)`
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 10px;
|
||||
|
||||
min-width: 195px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
height: 40px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
|
||||
${media.lessThan('795px')`
|
||||
margin-top: 10px;
|
||||
`}
|
||||
`;
|
||||
|
||||
const ShowAddressIcon = styled(Icon)`
|
||||
@ -105,6 +108,20 @@ const EyeButton = styled(Button)`
|
||||
right: 10px;
|
||||
`;
|
||||
|
||||
const Row = styled.div`
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
${media.lessThan('795px')`
|
||||
flex-direction: column;
|
||||
`}
|
||||
`;
|
||||
|
||||
const QrWrapper = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
||||
const AccountReceive = (props: Props) => {
|
||||
const device = props.wallet.selectedDevice;
|
||||
const {
|
||||
@ -132,18 +149,25 @@ const AccountReceive = (props: Props) => {
|
||||
<Content>
|
||||
<React.Fragment>
|
||||
<H2>Receive Ethereum or tokens</H2>
|
||||
<AddressWrapper
|
||||
isShowingQrCode={addressVerified || addressUnverified}
|
||||
>
|
||||
{isAddressVerifying && (
|
||||
<AddressInfoText>Confirm address on Trezor</AddressInfoText>
|
||||
)}
|
||||
<AddressWrapper isShowingQrCode={addressVerified || addressUnverified}>
|
||||
<Label>Address</Label>
|
||||
<Row>
|
||||
<Input
|
||||
type="text"
|
||||
value={address}
|
||||
isPartiallyHidden={isAddressHidden}
|
||||
isVerifying={isAddressVerifying}
|
||||
trezorAction={(
|
||||
<React.Fragment>
|
||||
<ArrowUp />
|
||||
<AddressInfoText>
|
||||
<Icon
|
||||
icon={ICONS.T1}
|
||||
color={colors.WHITE}
|
||||
/>
|
||||
Check address on your Trezor
|
||||
</AddressInfoText>
|
||||
</React.Fragment>
|
||||
)}
|
||||
icon={((addressVerified || addressUnverified) && !isAddressVerifying) && (
|
||||
<Tooltip
|
||||
placement="bottom"
|
||||
@ -169,20 +193,14 @@ const AccountReceive = (props: Props) => {
|
||||
</Tooltip>
|
||||
)}
|
||||
/>
|
||||
{isAddressVerifying && (
|
||||
<React.Fragment>
|
||||
<ArrowUp />
|
||||
<AddressInfoText>
|
||||
<Icon
|
||||
icon={ICONS.T1}
|
||||
color={colors.WHITE}
|
||||
/>
|
||||
Check address on your Trezor
|
||||
</AddressInfoText>
|
||||
</React.Fragment>
|
||||
{!(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) && (
|
||||
<React.Fragment>
|
||||
<QrWrapper>
|
||||
<Label>QR code</Label>
|
||||
<StyledQRCode
|
||||
bgColor="#FFFFFF"
|
||||
@ -191,12 +209,7 @@ const AccountReceive = (props: Props) => {
|
||||
style={{ width: 150 }}
|
||||
value={account.address}
|
||||
/>
|
||||
</React.Fragment>
|
||||
)}
|
||||
{!(addressVerified || addressUnverified) && (
|
||||
<ShowAddressButton onClick={() => props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}>
|
||||
<ShowAddressIcon icon={ICONS.EYE} color={colors.WHITE} />Show full address
|
||||
</ShowAddressButton>
|
||||
</QrWrapper>
|
||||
)}
|
||||
</AddressWrapper>
|
||||
</React.Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user