Browse Source

Hide amount of a new account to create as requested in pixel push

master
Gaëtan Renaudeau 7 years ago
parent
commit
66079fd198
  1. 13
      src/components/base/AccountsList/AccountRow.js
  2. 3
      src/components/base/AccountsList/index.js
  3. 1
      src/components/modals/AddAccounts/steps/03-step-import.js

13
src/components/base/AccountsList/AccountRow.js

@ -21,6 +21,7 @@ type Props = {
accountName: string, accountName: string,
onToggleAccount?: (Account, boolean) => void, onToggleAccount?: (Account, boolean) => void,
onEditName?: (Account, string) => void, onEditName?: (Account, string) => void,
hideAmount?: boolean,
} }
export default class AccountRow extends PureComponent<Props> { export default class AccountRow extends PureComponent<Props> {
@ -59,7 +60,15 @@ export default class AccountRow extends PureComponent<Props> {
_input = null _input = null
render() { render() {
const { account, isChecked, onEditName, accountName, isDisabled, autoFocusInput } = this.props const {
account,
isChecked,
onEditName,
accountName,
isDisabled,
autoFocusInput,
hideAmount,
} = this.props
return ( return (
<AccountRowContainer <AccountRowContainer
isDisabled={isDisabled} isDisabled={isDisabled}
@ -84,6 +93,7 @@ export default class AccountRow extends PureComponent<Props> {
<div style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}>{accountName}</div> <div style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}>{accountName}</div>
)} )}
</Box> </Box>
{!hideAmount ? (
<FormattedVal <FormattedVal
val={account.balance} val={account.balance}
unit={account.unit} unit={account.unit}
@ -91,6 +101,7 @@ export default class AccountRow extends PureComponent<Props> {
fontSize={4} fontSize={4}
color="grey" color="grey"
/> />
) : null}
{!isDisabled ? ( {!isDisabled ? (
<Radio disabled isChecked={isChecked || !!isDisabled} /> <Radio disabled isChecked={isChecked || !!isDisabled} />
) : ( ) : (

3
src/components/base/AccountsList/index.js

@ -24,6 +24,7 @@ class AccountsList extends Component<
emptyText?: string, emptyText?: string,
autoFocusFirstInput?: boolean, autoFocusFirstInput?: boolean,
collapsible?: boolean, collapsible?: boolean,
hideAmount?: boolean,
t: T, t: T,
}, },
{ {
@ -57,6 +58,7 @@ class AccountsList extends Component<
emptyText, emptyText,
autoFocusFirstInput, autoFocusFirstInput,
collapsible, collapsible,
hideAmount,
t, t,
} = this.props } = this.props
const { collapsed } = this.state const { collapsed } = this.state
@ -106,6 +108,7 @@ class AccountsList extends Component<
isChecked={!checkedIds || checkedIds.find(id => id === account.id) !== undefined} isChecked={!checkedIds || checkedIds.find(id => id === account.id) !== undefined}
onToggleAccount={onToggleAccount} onToggleAccount={onToggleAccount}
onEditName={setAccountName} onEditName={setAccountName}
hideAmount={hideAmount}
accountName={ accountName={
typeof editedNames[account.id] === 'string' typeof editedNames[account.id] === 'string'
? editedNames[account.id] ? editedNames[account.id]

1
src/components/modals/AddAccounts/steps/03-step-import.js

@ -275,6 +275,7 @@ class StepImport extends PureComponent<StepProps> {
onToggleAccount={this.handleToggleAccount} onToggleAccount={this.handleToggleAccount}
setAccountName={setAccountName} setAccountName={setAccountName}
editedNames={editedNames} editedNames={editedNames}
hideAmount
/> />
)} )}
{scanStatus === 'scanning' ? ( {scanStatus === 'scanning' ? (

Loading…
Cancel
Save