From 40d89153100db406daf801d36ade9d8165a1599b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 10:09:48 +0200 Subject: [PATCH] Polish operationslist: Drop always true prop --- src/components/AccountPage/index.js | 2 +- src/components/DashboardPage/index.js | 1 - src/components/OperationsList/index.js | 24 +++++++++++++----------- src/components/OperationsList/stories.js | 6 +----- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/components/AccountPage/index.js b/src/components/AccountPage/index.js index 95080626..5bd21ee9 100644 --- a/src/components/AccountPage/index.js +++ b/src/components/AccountPage/index.js @@ -180,7 +180,7 @@ class AccountPage extends PureComponent { )} /> - + ) : ( diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index 4e43c8f1..b3b78deb 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -167,7 +167,6 @@ class DashboardPage extends PureComponent { {displayOperations && ( *, t: T, withAccount?: boolean, title?: string, @@ -66,10 +65,12 @@ type State = { const initialState = { nbToShow: 20, } + +const footerPlaceholder = null // TODO figure out with design what we want here + export class OperationsList extends PureComponent { static defaultProps = { withAccount: false, - canShowMore: false, } state = initialState @@ -86,7 +87,7 @@ export class OperationsList extends PureComponent { } render() { - const { account, accounts, canShowMore, t, title, withAccount } = this.props + const { account, accounts, t, title, withAccount } = this.props const { nbToShow } = this.state if (!account && !accounts) { @@ -130,13 +131,14 @@ export class OperationsList extends PureComponent { ))} - {canShowMore && - !groupedOperations.completed && ( - - {t('operationsList:showMore')} - - - )} + {!groupedOperations.completed ? ( + + {t('operationsList:showMore')} + + + ) : ( + footerPlaceholder + )} ) diff --git a/src/components/OperationsList/stories.js b/src/components/OperationsList/stories.js index b8237619..5324fb8a 100644 --- a/src/components/OperationsList/stories.js +++ b/src/components/OperationsList/stories.js @@ -15,10 +15,6 @@ const account2 = genAccount('account2') stories.add('OperationsList', () => ( - + ))