From d35b62b33652a8c4795148db5b05a80bff502edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=ABck=20V=C3=A9zien?= Date: Tue, 17 Apr 2018 14:04:40 +0200 Subject: [PATCH] Update CurrentAddress design --- src/components/CurrentAddress/index.js | 94 +++++++++++-------- src/components/CurrentAddress/stories.js | 3 +- src/components/base/Modal/index.js | 11 +-- src/components/layout/Print.js | 7 +- .../modals/Receive/04-step-receive-funds.js | 6 +- static/i18n/en/currentAddress.yml | 1 + 6 files changed, 66 insertions(+), 56 deletions(-) diff --git a/src/components/CurrentAddress/index.js b/src/components/CurrentAddress/index.js index 977029d5..1b95a372 100644 --- a/src/components/CurrentAddress/index.js +++ b/src/components/CurrentAddress/index.js @@ -1,7 +1,7 @@ // @flow import React, { PureComponent } from 'react' -import { translate } from 'react-i18next' +import { Trans, translate } from 'react-i18next' import styled from 'styled-components' import noop from 'lodash/noop' @@ -25,20 +25,12 @@ import IconShield from 'icons/Shield' const Container = styled(Box).attrs({ borderRadius: 1, alignItems: 'center', - bg: p => (p.withQRCode ? 'lightGrey' : 'transparent'), - py: 5, + bg: p => + p.withQRCode ? (p.notValid ? rgba(p.theme.colors.alertRed, 0.02) : 'lightGrey') : 'transparent', + py: 4, px: 7, -})`` - -const WrapperAddress = styled(Box).attrs({ - alignItems: 'center', - borderRadius: 1, - py: p => (p.notValid ? 4 : 0), - px: 4, })` - background: ${p => (p.notValid ? rgba(p.theme.colors.alertRed, 0.05) : 'transparent')}; - border: ${p => (p.notValid ? `1px dashed ${rgba(p.theme.colors.alertRed, 0.26)}` : 'none')}; - width: 100%; + border: ${p => (p.notValid ? `1px dashed ${rgba(p.theme.colors.alertRed, 0.5)}` : 'none')}; ` const Address = styled(Box).attrs({ @@ -63,11 +55,17 @@ const Label = styled(Box).attrs({ fontSize: 4, flow: 1, horizontal: true, -})`` +})` + strong { + color: ${p => p.theme.colors.dark}; + font-weight: 600; + border-bottom: 1px dashed ${p => p.theme.colors.dark}; + } +` const Footer = styled(Box).attrs({ horizontal: true, - mt: 5, + mt: 4, })` text-transform: uppercase; width: 100%; @@ -77,9 +75,20 @@ const FooterButtonWrapper = styled(Box).attrs({ color: 'grey', alignItems: 'center', justifyContent: 'center', - grow: true, + borderRadius: 1, })` cursor: pointer; + height: 55px; + width: 55px; + + &:hover { + background-color: rgba(100, 144, 241, 0.1); + color: ${p => p.theme.colors.dark}; + + svg { + color: ${p => p.theme.colors.wallet}; + } + } ` const FooterButton = ({ @@ -91,15 +100,18 @@ const FooterButton = ({ label: string, onClick: Function, }) => ( - - {icon} - - {label} - - + + + {icon} + + {label} + + + ) type Props = { + accountName?: string, address: string, addressVerified?: boolean, amount?: string, @@ -130,6 +142,7 @@ class CurrentAddress extends PureComponent { render() { const { + accountName, address, addressVerified, amount, @@ -149,20 +162,27 @@ class CurrentAddress extends PureComponent { return ( - - {withQRCode && ( - - - - )} - -
- {address} -
-
+ {withQRCode && ( + + + + )} + +
+ {address} +
{withBadge && ( @@ -186,7 +206,7 @@ class CurrentAddress extends PureComponent { )} /> ( } diff --git a/src/components/CurrentAddress/stories.js b/src/components/CurrentAddress/stories.js index 188b4c00..bc665a32 100644 --- a/src/components/CurrentAddress/stories.js +++ b/src/components/CurrentAddress/stories.js @@ -2,7 +2,7 @@ import React from 'react' import { storiesOf } from '@storybook/react' -import { boolean } from '@storybook/addon-knobs' +import { boolean, text } from '@storybook/addon-knobs' import CurrentAddress from 'components/CurrentAddress' @@ -12,6 +12,7 @@ const stories = storiesOf('Components', module) stories.add('CurrentAddress', () => ( const Container = styled(Box).attrs({ color: 'grey', - alignItems: 'center', - justifyContent: 'flex-start', sticky: true, style: p => ({ pointerEvents: p.isVisible ? 'auto' : 'none', @@ -79,8 +77,6 @@ const Backdrop = styled(Box).attrs({ const Wrapper = styled(Tabbable).attrs({ bg: 'transparent', flow: 4, - mt: 100, - mb: 100, style: p => ({ opacity: p.op, transform: `scale3d(${p.scale}, ${p.scale}, ${p.scale})`, @@ -175,12 +171,7 @@ export class Modal extends Component { {(m, isVisible, isAnimated) => ( - + { if (!data) { return null } - const { address, amount } = data + const { address, amount, accountName } = data return ( (this._node = n)} - amount={amount} + accountName={accountName} address={address} + amount={amount} + innerRef={n => (this._node = n)} withQRCode /> ) diff --git a/src/components/modals/Receive/04-step-receive-funds.js b/src/components/modals/Receive/04-step-receive-funds.js index 9a51f66f..efe220f7 100644 --- a/src/components/modals/Receive/04-step-receive-funds.js +++ b/src/components/modals/Receive/04-step-receive-funds.js @@ -8,7 +8,6 @@ import type { T } from 'types/common' import Box from 'components/base/Box' import CurrentAddress from 'components/CurrentAddress' import Label from 'components/base/Label' -import SelectAccount from 'components/SelectAccount' import RequestAmount from 'components/RequestAmount' type Props = { @@ -22,10 +21,6 @@ type Props = { export default (props: Props) => ( - - - - ( /> <0>{{accountName}}