From b58cff72ff820a029f8f6f1f258054d6792d3883 Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Mon, 29 Apr 2019 15:46:24 +0200 Subject: [PATCH] fix rendering of validation error for advanced send eth --- .../ethereum/components/AdvancedForm/index.js | 28 +++++++++++++++++-- .../views/Account/Send/ethereum/index.js | 12 ++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/views/Wallet/views/Account/Send/ethereum/components/AdvancedForm/index.js b/src/views/Wallet/views/Account/Send/ethereum/components/AdvancedForm/index.js index ebcfa99b..3c25795e 100644 --- a/src/views/Wallet/views/Account/Send/ethereum/components/AdvancedForm/index.js +++ b/src/views/Wallet/views/Account/Send/ethereum/components/AdvancedForm/index.js @@ -234,7 +234,15 @@ const AdvancedForm = (props: Props) => { )} } - bottomText={errors.gasLimit || warnings.gasLimit || infos.gasLimit} + bottomText={ + <> + {(errors.gasLimit && ) || + (warnings.gasLimit && ( + + )) || + (infos.gasLimit && )} + + } value={ calculatingGasLimit ? props.intl.formatMessage(l10nMessages.TR_CALCULATING_DOT_DOT) @@ -292,7 +300,15 @@ const AdvancedForm = (props: Props) => { } - bottomText={errors.gasPrice || warnings.gasPrice || infos.gasPrice} + bottomText={ + <> + {(errors.gasPrice && ) || + (warnings.gasPrice && ( + + )) || + (infos.v && )} + + } value={gasPrice} onChange={event => onGasPriceChange(event.target.value)} /> @@ -323,7 +339,13 @@ const AdvancedForm = (props: Props) => { } state={getDataTextareaState(!!errors.data, !!warnings.data)} - bottomText={errors.data || warnings.data || infos.data} + bottomText={ + <> + {(errors.data && ) || + (warnings.data && ) || + (infos.data && )} + + } isDisabled={networkSymbol !== currency} value={networkSymbol !== currency ? '' : data} onChange={event => onDataChange(event.target.value)} diff --git a/src/views/Wallet/views/Account/Send/ethereum/index.js b/src/views/Wallet/views/Account/Send/ethereum/index.js index dbb3c8ff..d02328c2 100644 --- a/src/views/Wallet/views/Account/Send/ethereum/index.js +++ b/src/views/Wallet/views/Account/Send/ethereum/index.js @@ -355,9 +355,9 @@ const AccountSend = (props: Props) => { topLabel={props.intl.formatMessage(l10nCommonMessages.TR_ADDRESS)} bottomText={ <> - {errors.address && } - {warnings.address && } - {infos.address && } + {(errors.address && ) || + (warnings.address && ) || + (infos.address && )} } value={address} @@ -399,9 +399,9 @@ const AccountSend = (props: Props) => { onChange={event => onAmountChange(event.target.value)} bottomText={ <> - {errors.amount && } - {warnings.amount && } - {infos.amount && } + {(errors.amount && ) || + (warnings.amount && ) || + (infos.amount && )} } sideAddons={[