From d682833aa3cf3f0f295f2b6a8fa79b93fb7ca5b2 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 30 Oct 2018 15:51:01 +0100 Subject: [PATCH] Make initial layout responsive --- src/components/inputs/Input/index.js | 1 + .../Wallet/views/Account/Receive/index.js | 133 ++++++++++-------- 2 files changed, 74 insertions(+), 60 deletions(-) diff --git a/src/components/inputs/Input/index.js b/src/components/inputs/Input/index.js index 54fd8fdb..5d910bed 100644 --- a/src/components/inputs/Input/index.js +++ b/src/components/inputs/Input/index.js @@ -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%; diff --git a/src/views/Wallet/views/Account/Receive/index.js b/src/views/Wallet/views/Account/Receive/index.js index a0eba06a..3339e286 100644 --- a/src/views/Wallet/views/Account/Receive/index.js +++ b/src/views/Wallet/views/Account/Receive/index.js @@ -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,57 +149,58 @@ const AccountReceive = (props: Props) => {

Receive Ethereum or tokens

- - {isAddressVerifying && ( - Confirm address on Trezor - )} + - - )} - > - props.showAddress(account.addressPath)} + + + + + + Check address on your Trezor + +
+ )} + icon={((addressVerified || addressUnverified) && !isAddressVerifying) && ( + + )} > - - - - - + props.showAddress(account.addressPath)} + > + + + + + + )} + /> + {!(addressVerified || addressUnverified) && ( + props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}> + Show full address + )} - /> - {isAddressVerifying && ( - - - - - Check address on your Trezor - - - )} + {(addressVerified || addressUnverified) && ( - + { style={{ width: 150 }} value={account.address} /> - - )} - {!(addressVerified || addressUnverified) && ( - props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}> - Show full address - + )}