From ec9d8bd02af15f80d0a67968761f6d46373aed9d Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Thu, 31 May 2018 17:45:01 +0200 Subject: [PATCH] empty state for the account page, no transactions on dashboard --- .../AccountPage/EmptyStateAccount.js | 58 +++++++ src/components/AccountPage/index.js | 146 ++++++++++-------- src/components/DashboardPage/EmptyState.js | 4 +- src/components/DashboardPage/index.js | 21 ++- src/icons/AccountSettings.js | 16 ++ static/i18n/en/account.yml | 5 + static/images/logos/emptyStateAccount.png | Bin 0 -> 9066 bytes 7 files changed, 174 insertions(+), 76 deletions(-) create mode 100644 src/components/AccountPage/EmptyStateAccount.js create mode 100644 src/icons/AccountSettings.js create mode 100644 static/images/logos/emptyStateAccount.png diff --git a/src/components/AccountPage/EmptyStateAccount.js b/src/components/AccountPage/EmptyStateAccount.js new file mode 100644 index 00000000..e7986f9d --- /dev/null +++ b/src/components/AccountPage/EmptyStateAccount.js @@ -0,0 +1,58 @@ +// @flow + +import React, { PureComponent } from 'react' +import { i } from 'helpers/staticPath' +import styled from 'styled-components' +import { connect } from 'react-redux' +import { compose } from 'redux' +import { translate } from 'react-i18next' + +import { openModal } from 'reducers/modals' +import type { T } from 'types/common' +import type { Account } from '@ledgerhq/live-common/lib/types' + +import { MODAL_RECEIVE } from 'config/constants' + +import Box from 'components/base/Box' +import Button from 'components/base/Button' +import { Title, Description } from 'components/DashboardPage/EmptyState' +import IconReceive from 'icons/Receive' + +const mapDispatchToProps = { + openModal, +} + +type Props = { + t: T, + account: Account, + openModal: Function, +} + +class EmptyStateAccount extends PureComponent { + render() { + const { t, account, openModal } = this.props + + return ( + + emptyState Dashboard logo + + {t('account:emptyState.title')} + {t('account:emptyState.desc')} + + + + ) + } +} + +export default compose(connect(null, mapDispatchToProps), translate())(EmptyStateAccount) diff --git a/src/components/AccountPage/index.js b/src/components/AccountPage/index.js index f972c9f7..7bd5c134 100644 --- a/src/components/AccountPage/index.js +++ b/src/components/AccountPage/index.js @@ -1,6 +1,6 @@ // @flow -import React, { PureComponent } from 'react' +import React, { PureComponent, Fragment } from 'react' import { compose } from 'redux' import { connect } from 'react-redux' import { translate } from 'react-i18next' @@ -18,7 +18,7 @@ import { getAccountById } from 'reducers/accounts' import { counterValueCurrencySelector, localeSelector } from 'reducers/settings' import { openModal } from 'reducers/modals' -import IconControls from 'icons/Controls' +import IconAccountSettings from 'icons/AccountSettings' import IconReceive from 'icons/Receive' import IconSend from 'icons/Send' @@ -35,6 +35,7 @@ import PillsDaysCount from 'components/PillsDaysCount' import OperationsList from 'components/OperationsList' import AccountHeader from './AccountHeader' +import EmptyStateAccount from './EmptyStateAccount' const ButtonSettings = styled(Button).attrs({ small: true, @@ -99,78 +100,89 @@ class AccountPage extends PureComponent { - - + {account.operations.length > 0 && ( + + + + + + )} openModal(MODAL_SETTINGS_ACCOUNT, { account })}> - + - - ( - - - - - - - + {account.operations.length > 0 ? ( + + + ( + + + + + + + + + + + + + - - - - - - - )} - /> - - + )} + /> + + + + ) : ( + + )} ) } diff --git a/src/components/DashboardPage/EmptyState.js b/src/components/DashboardPage/EmptyState.js index cb1f2562..48bf8fc8 100644 --- a/src/components/DashboardPage/EmptyState.js +++ b/src/components/DashboardPage/EmptyState.js @@ -64,13 +64,13 @@ class EmptyState extends PureComponent { } } -const Title = styled(Box).attrs({ +export const Title = styled(Box).attrs({ ff: 'Museo Sans|Regular', fontSize: 6, color: p => p.theme.colors.dark, })`` -const Description = styled(Box).attrs({ +export const Description = styled(Box).attrs({ ff: 'Open Sans|Regular', fontSize: 4, color: p => p.theme.colors.graphite, diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index 3027da19..80343277 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -108,6 +108,11 @@ class DashboardPage extends PureComponent { const timeFrame = this.handleGreeting() const totalAccounts = accounts.length + const displayOperationsHelper = (account: Account) => { + return account.operations.length > 0 + } + const displayOperations = accounts.some(displayOperationsHelper) + return ( {totalAccounts > 0 ? ( @@ -186,13 +191,15 @@ class DashboardPage extends PureComponent { ))} - push(`/account/${account.id}`)} - accounts={accounts} - title={t('dashboard:recentActivity')} - withAccount - /> + {displayOperations && ( + push(`/account/${account.id}`)} + accounts={accounts} + title={t('dashboard:recentActivity')} + withAccount + /> + )} ) : ( diff --git a/src/icons/AccountSettings.js b/src/icons/AccountSettings.js new file mode 100644 index 00000000..3bb3053e --- /dev/null +++ b/src/icons/AccountSettings.js @@ -0,0 +1,16 @@ +// @flow + +import React from 'react' + +const path = ( + +) + +export default ({ size, ...p }: { size: number }) => ( + + {path} + +) diff --git a/static/i18n/en/account.yml b/static/i18n/en/account.yml index 66126329..be9e4d8a 100644 --- a/static/i18n/en/account.yml +++ b/static/i18n/en/account.yml @@ -1,6 +1,11 @@ balance: Balance receive: Receive lastOperations: Last operations +emptyState: + title: This is a title, use it with caution + desc: Please create a new account or recover an old account from your Ledger device. + buttons: + receiveFunds: Receive Funds settings: title: Edit Account accountName: diff --git a/static/images/logos/emptyStateAccount.png b/static/images/logos/emptyStateAccount.png new file mode 100644 index 0000000000000000000000000000000000000000..094ab0517a8a70a7752c4bce4e6ba08c0fa41bce GIT binary patch literal 9066 zcmb_iXH-+$)=lU|5K-EtBnpTM2m%69LQtfLbfptINS9th2~tGi(u;Idib(G@6j3@N zAT`8*^b)!h1Na5K_YvNBKfgbRjB(D{Wvw~qnrk0ksH-Z_Q2j*(003x|6y-Dl0Aeuy zcR2+a{#q|ufW-d+x@s!i1r&c~TLJ($xs>E&A9(?>Xt=$_s8P$Na7LN*j1fvWlBZ!@ z=Z#}YzMazZ%#ezx1s9M~E zoIx2B)_PKkN5$JWtt4m~*RmJ59>m##Q6q2L!2cx1kn14Ug9=(P&;5NttIPrD_pqv& z!{(Zq0~x6+lb_^Aft?c*6P(peG8HrjpH!FA)6ztE)H0+r-CSLVR@c`-T|+e8tU*!! ztPv-JPj8@F_GJ0?aZmUEp2Cm*yv>O?0JM*r@@L(L?BH;Mw{B^qWM=+iV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