From 49fd743640e9bc70d715e242e9dc1a72edc5fe5d Mon Sep 17 00:00:00 2001 From: meriadec Date: Thu, 1 Mar 2018 17:58:59 +0100 Subject: [PATCH] Work on Account page --- src/components/AccountPage/AccountHeader.js | 46 +++++++++++++++++++ .../{AccountPage.js => AccountPage/index.js} | 29 +++--------- src/components/TransactionsList/index.js | 5 ++ 3 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 src/components/AccountPage/AccountHeader.js rename src/components/{AccountPage.js => AccountPage/index.js} (78%) diff --git a/src/components/AccountPage/AccountHeader.js b/src/components/AccountPage/AccountHeader.js new file mode 100644 index 00000000..9f01e89a --- /dev/null +++ b/src/components/AccountPage/AccountHeader.js @@ -0,0 +1,46 @@ +// @flow + +import React, { PureComponent } from 'react' +import { getIconByCoinType } from '@ledgerhq/currencies/react' +import styled from 'styled-components' + +import type { Account } from 'types/common' + +import Box from 'components/base/Box' +import Text from 'components/base/Text' + +const CurName = styled(Text).attrs({ + ff: 'Open Sans|SemiBold', + fontSize: 2, +})` + text-transform: uppercase; + letter-spacing: 1px; +` + +type Props = { + account: Account, +} + +class AccountHeader extends PureComponent { + render() { + const { account } = this.props + const Icon = getIconByCoinType(account.currency.coinType) + return ( + + {Icon && ( + + + + )} + + {account.currency.name} + + {account.name} + + + + ) + } +} + +export default AccountHeader diff --git a/src/components/AccountPage.js b/src/components/AccountPage/index.js similarity index 78% rename from src/components/AccountPage.js rename to src/components/AccountPage/index.js index 2f94a9e3..b801e307 100644 --- a/src/components/AccountPage.js +++ b/src/components/AccountPage/index.js @@ -20,9 +20,9 @@ import Box, { Card } from 'components/base/Box' import Button from 'components/base/Button' import Icon from 'components/base/Icon' import IconControls from 'icons/Controls' -import ReceiveBox from 'components/ReceiveBox' import Text from 'components/base/Text' import TransactionsList from 'components/TransactionsList' +import AccountHeader from './AccountHeader' type Props = { t: T, @@ -48,11 +48,9 @@ class AccountPage extends PureComponent { } return ( - + - - {account.name} - + - - - - {formatBTC(account.balance)} - - - - - - - - - + + {formatBTC(account.balance)} + diff --git a/src/components/TransactionsList/index.js b/src/components/TransactionsList/index.js index b3e98b59..ff211728 100644 --- a/src/components/TransactionsList/index.js +++ b/src/components/TransactionsList/index.js @@ -58,12 +58,17 @@ const TransactionRaw = styled(Box).attrs({ horizontal: true, alignItems: 'center', })` + cursor: pointer; border-bottom: 1px solid ${p => p.theme.colors.fog}; height: 68px; &:last-child { border-bottom: 0; } + + &:hover { + background: ${p => p.theme.colors.lightGrey}; + } ` const Cell = styled(Box).attrs({