From 980f240884ec3fc3cf69d2df45bd0f96a5c7147f Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 26 Jan 2018 10:06:17 +0100 Subject: [PATCH 1/3] Update TopBar style --- src/components/TopBar.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/components/TopBar.js b/src/components/TopBar.js index beb0f983..761d0941 100644 --- a/src/components/TopBar.js +++ b/src/components/TopBar.js @@ -1,6 +1,6 @@ // @flow -import React, { PureComponent, Fragment } from 'react' +import React, { PureComponent } from 'react' import { connect } from 'react-redux' import { ipcRenderer } from 'electron' @@ -97,25 +97,23 @@ class TopBar extends PureComponent { const { sync } = this.state return ( - - - - {sync.progress === true - ? 'sync...' - : sync.fail === true ? 'sync fail :(' : 'sync finish!'} - - - {hasPassword && } - - + + + {sync.progress === true + ? 'Synchronizing...' + : sync.fail === true ? 'Synchronization fail :(' : 'Synchronisation finished!'} - + + {hasPassword && } + + + ) } } const CountDevices = ({ count } = { count: Number }) => ( - + From 8a080ff4dde1cc5e16daed26ce77acb08e16a042 Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 26 Jan 2018 10:17:57 +0100 Subject: [PATCH 2/3] Update display of account in Dashboard page --- src/components/DashboardPage.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DashboardPage.js b/src/components/DashboardPage.js index cc3be0d4..16d3f9b0 100644 --- a/src/components/DashboardPage.js +++ b/src/components/DashboardPage.js @@ -135,8 +135,12 @@ class DashboardPage extends PureComponent { style={{ cursor: 'pointer', height: 200 }} onClick={() => push(`/account/${key}`)} > -
{accounts[key].name}
-
{accounts[key].data && formatBTC(accounts[key].data.balance)}
+ + {accounts[key].name} + + + {accounts[key].data && formatBTC(accounts[key].data.balance)} + ), )} From 0643bd24e71d67b512159115f4c64290bf50f852 Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 26 Jan 2018 11:23:16 +0100 Subject: [PATCH 3/3] Start splitting SelectAccount and ReceiveBox --- src/components/AccountPage.js | 52 ++------------------ src/components/ReceiveBox.js | 75 +++++++++++++++++++++++++++++ src/components/SelectAccount.js | 41 ++++++++++++++++ src/components/base/Select/index.js | 8 +-- src/components/modals/Receive.js | 36 ++++++++++++-- static/i18n/en/translation.yml | 1 + static/i18n/fr/translation.yml | 1 + 7 files changed, 158 insertions(+), 56 deletions(-) create mode 100644 src/components/ReceiveBox.js create mode 100644 src/components/SelectAccount.js diff --git a/src/components/AccountPage.js b/src/components/AccountPage.js index 9fccecba..0ace4d77 100644 --- a/src/components/AccountPage.js +++ b/src/components/AccountPage.js @@ -2,7 +2,6 @@ import React, { PureComponent, Fragment } from 'react' import { connect } from 'react-redux' -import styled from 'styled-components' import type { MapStateToProps } from 'react-redux' import type { Account, AccountData } from 'types/common' @@ -14,8 +13,7 @@ import { getAccountById, getAccountData } from 'reducers/accounts' import TransactionsList from 'components/TransactionsList' import Box, { Card } from 'components/base/Box' import Text from 'components/base/Text' -import QRCode from 'components/base/QRCode' -import CopyToClipboard from 'components/base/CopyToClipboard' +import ReceiveBox from 'components/ReceiveBox' type Props = { account: Account, @@ -27,32 +25,6 @@ const mapStateToProps: MapStateToProps<*, *, *> = (state, props) => ({ accountData: getAccountData(state, props.match.params.id), }) -const AddressBox = styled(Box).attrs({ - borderWidth: 1, - borderColor: 'mouse', - bg: 'cream', - p: 2, -})` - text-align: center; - word-break: break-all; - border-radius: 3px; - user-select: text; -` - -const Action = styled(Box).attrs({ - color: 'mouse', - fontSize: 0, -})` - font-weight: bold; - text-align: center; - cursor: pointer; - text-transform: uppercase; - - &:hover { - color: ${p => p.theme.colors.grey}; - } -` - class AccountPage extends PureComponent { render() { const { account, accountData } = this.props @@ -66,32 +38,14 @@ class AccountPage extends PureComponent { - + {formatBTC(accountData.balance)} - - - - - {'Current address'} - {accountData.address} - - - ( - - {'Copy'} - - )} - /> - {'Print'} - {'Share'} - + diff --git a/src/components/ReceiveBox.js b/src/components/ReceiveBox.js new file mode 100644 index 00000000..7e708658 --- /dev/null +++ b/src/components/ReceiveBox.js @@ -0,0 +1,75 @@ +// @flow + +import React from 'react' +import styled from 'styled-components' + +import Box from 'components/base/Box' +import QRCode from 'components/base/QRCode' +import Icon from 'components/base/Icon' +import CopyToClipboard from 'components/base/CopyToClipboard' +import Text from 'components/base/Text' + +type Props = { + address: string, +} + +const AddressBox = styled(Box).attrs({ + borderWidth: 1, + borderColor: 'mouse', + bg: 'cream', + p: 2, +})` + text-align: center; + word-break: break-all; + border-radius: 3px; + user-select: text; +` + +const Action = styled(Box).attrs({ + flow: 1, + flex: 1, + color: 'mouse', + fontSize: 0, +})` + font-weight: bold; + text-align: center; + cursor: pointer; + text-transform: uppercase; + + &:hover { + color: ${p => p.theme.colors.grey}; + } +` + +const ReceiveBox = ({ address }: Props) => ( + + + + + + {'Current address'} + {address} + + + ( + + + {'Copy'} + + )} + /> + + + {'Print'} + + + + {'Share'} + + + +) + +export default ReceiveBox diff --git a/src/components/SelectAccount.js b/src/components/SelectAccount.js new file mode 100644 index 00000000..e187f9aa --- /dev/null +++ b/src/components/SelectAccount.js @@ -0,0 +1,41 @@ +// @flow + +import React from 'react' +import { connect } from 'react-redux' +import values from 'lodash/values' + +import type { MapStateToProps } from 'react-redux' + +import { getAccounts } from 'reducers/accounts' +import Select from 'components/base/Select' +import Text from 'components/base/Text' + +import type { Account } from 'types/common' + +const mapStateToProps: MapStateToProps<*, *, *> = state => ({ + accounts: values(getAccounts(state)), +}) + +type Props = { + accounts: Array, + onChange: () => Account | void, + value: Account | null, +} + +const SelectAccount = ({ accounts, value, onChange }: Props) => ( +