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. 27
      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

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

3
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]

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

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

Loading…
Cancel
Save