From 140425a61dc7dd5519897daaeaa0f4edf496d7a1 Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Thu, 21 Jun 2018 12:30:27 +0200 Subject: [PATCH] wip empty account tile --- src/components/DashboardPage/index.js | 65 +++++++++++++++---- src/icons/illustrations/emptyAccountTile.js | 72 +++++++++++++++++++++ 2 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 src/icons/illustrations/emptyAccountTile.js diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index c92116ce..b05f7cb0 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -4,15 +4,17 @@ import React, { PureComponent, Fragment } from 'react' import { compose } from 'redux' import { translate } from 'react-i18next' import { connect } from 'react-redux' +import styled from 'styled-components' import { push } from 'react-router-redux' import { createStructuredSelector } from 'reselect' - import type { Account, Currency } from '@ledgerhq/live-common/lib/types' import type { T } from 'types/common' import { colors } from 'styles/theme' import { accountsSelector } from 'reducers/accounts' +import { openModal } from 'reducers/modals' +import { MODAL_ADD_ACCOUNTS } from 'config/constants' import { counterValueCurrencySelector, localeSelector, @@ -28,6 +30,9 @@ import UpdateNotifier from 'components/UpdateNotifier' import BalanceInfos from 'components/BalanceSummary/BalanceInfos' import BalanceSummary from 'components/BalanceSummary' import Box from 'components/base/Box' +import IconEmptyAccountTile from 'icons/illustrations/EmptyAccountTile' +import Button from '../base/Button/index' +import Card from '../base/Box/Card' import PillsDaysCount from 'components/PillsDaysCount' import Text from 'components/base/Text' import OperationsList from 'components/OperationsList' @@ -48,6 +53,7 @@ const mapDispatchToProps = { push, reorderAccounts, saveSettings, + openModal, } type Props = { @@ -57,6 +63,7 @@ type Props = { counterValue: Currency, selectedTimeRange: TimeRange, saveSettings: ({ selectedTimeRange: TimeRange }) => *, + openModal: string => void, } class DashboardPage extends PureComponent { @@ -82,11 +89,10 @@ class DashboardPage extends PureComponent { _cacheBalance = null render() { - const { accounts, t, counterValue, selectedTimeRange } = this.props + const { accounts, t, counterValue, selectedTimeRange, openModal } = this.props const daysCount = timeRangeDaysByKey[selectedTimeRange] const timeFrame = this.handleGreeting() const totalAccounts = accounts.length - const displayOperationsHelper = (account: Account) => account.operations.length > 0 const displayOperations = accounts.some(displayOperationsHelper) @@ -155,17 +161,43 @@ class DashboardPage extends PureComponent { style={{ margin: '0 -16px' }} > {accounts - .concat(Array(3 - (accounts.length % 3)).fill(null)) + .concat( + Array(3 - (accounts.length % 3)) + .fill(null) + .map((_, i) => i === 0), + ) .map((account, i) => ( - + {account ? ( - + typeof account === 'object' ? ( + + ) : ( + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit + + + + ) ) : null} ))} @@ -198,3 +230,12 @@ export default compose( ), translate(), )(DashboardPage) + +const Wrapper = styled(Box).attrs({ + p: 4, + flex: 1, + alignItems: 'center', +})` + border: 1px dashed ${p => p.theme.colors.fog}; + border-radius: 4px; +` diff --git a/src/icons/illustrations/emptyAccountTile.js b/src/icons/illustrations/emptyAccountTile.js new file mode 100644 index 00000000..54e82ddb --- /dev/null +++ b/src/icons/illustrations/emptyAccountTile.js @@ -0,0 +1,72 @@ +// @flow + +import React from 'react' + +export default () => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +)