From 66079fd19800ec90359e0f963b54ac91c0ac922f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 28 Jun 2018 21:33:13 +0200 Subject: [PATCH] Hide amount of a new account to create as requested in pixel push --- .../base/AccountsList/AccountRow.js | 27 +++++++++++++------ src/components/base/AccountsList/index.js | 3 +++ .../AddAccounts/steps/03-step-import.js | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/components/base/AccountsList/AccountRow.js b/src/components/base/AccountsList/AccountRow.js index 0b3fce50..0c55fda3 100644 --- a/src/components/base/AccountsList/AccountRow.js +++ b/src/components/base/AccountsList/AccountRow.js @@ -21,6 +21,7 @@ type Props = { accountName: string, onToggleAccount?: (Account, boolean) => void, onEditName?: (Account, string) => void, + hideAmount?: boolean, } export default class AccountRow extends PureComponent { @@ -59,7 +60,15 @@ export default class AccountRow extends PureComponent { _input = null render() { - const { account, isChecked, onEditName, accountName, isDisabled, autoFocusInput } = this.props + const { + account, + isChecked, + onEditName, + accountName, + isDisabled, + autoFocusInput, + hideAmount, + } = this.props return ( {
{accountName}
)} - + {!hideAmount ? ( + + ) : null} {!isDisabled ? ( ) : ( diff --git a/src/components/base/AccountsList/index.js b/src/components/base/AccountsList/index.js index 3dc55fdf..024c050c 100644 --- a/src/components/base/AccountsList/index.js +++ b/src/components/base/AccountsList/index.js @@ -24,6 +24,7 @@ class AccountsList extends Component< emptyText?: string, autoFocusFirstInput?: boolean, collapsible?: boolean, + hideAmount?: boolean, t: T, }, { @@ -57,6 +58,7 @@ class AccountsList extends Component< emptyText, autoFocusFirstInput, collapsible, + hideAmount, t, } = this.props const { collapsed } = this.state @@ -106,6 +108,7 @@ class AccountsList extends Component< isChecked={!checkedIds || checkedIds.find(id => id === account.id) !== undefined} onToggleAccount={onToggleAccount} onEditName={setAccountName} + hideAmount={hideAmount} accountName={ typeof editedNames[account.id] === 'string' ? editedNames[account.id] diff --git a/src/components/modals/AddAccounts/steps/03-step-import.js b/src/components/modals/AddAccounts/steps/03-step-import.js index 7c91b17f..6f8385af 100644 --- a/src/components/modals/AddAccounts/steps/03-step-import.js +++ b/src/components/modals/AddAccounts/steps/03-step-import.js @@ -275,6 +275,7 @@ class StepImport extends PureComponent { onToggleAccount={this.handleToggleAccount} setAccountName={setAccountName} editedNames={editedNames} + hideAmount /> )} {scanStatus === 'scanning' ? (