mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-05 04:41:25 +00:00
showDefaultGasLimitButton condition
This commit is contained in:
parent
a944b9287e
commit
4589bb9171
@ -138,6 +138,7 @@ const AdvancedForm = (props: Props) => {
|
||||
errors,
|
||||
warnings,
|
||||
infos,
|
||||
touched,
|
||||
data,
|
||||
gasLimit,
|
||||
gasPrice,
|
||||
@ -158,6 +159,8 @@ const AdvancedForm = (props: Props) => {
|
||||
gasLimitTooltipValue = network.defaultGasLimit.toString(10);
|
||||
}
|
||||
|
||||
const showDefaultGasLimitButton = data.length === 0 && touched.gasLimit;
|
||||
|
||||
return (
|
||||
<AdvancedSettingsWrapper>
|
||||
<GasInputRow>
|
||||
@ -190,13 +193,15 @@ const AdvancedForm = (props: Props) => {
|
||||
/>
|
||||
</Tooltip>
|
||||
</Left>
|
||||
<Right onClick={() => setDefaultGasLimit()}>
|
||||
Set default
|
||||
</Right>
|
||||
{ showDefaultGasLimitButton && (
|
||||
<Right onClick={() => setDefaultGasLimit()}>
|
||||
Set default
|
||||
</Right>)
|
||||
}
|
||||
</InputLabelWrapper>
|
||||
)}
|
||||
bottomText={errors.gasLimit || warnings.gasLimit || infos.gasLimit || (calculatingGasLimit ? 'Calculating...' : '')}
|
||||
value={gasLimit}
|
||||
bottomText={errors.gasLimit || warnings.gasLimit || infos.gasLimit}
|
||||
value={calculatingGasLimit ? 'Calculating...' : gasLimit}
|
||||
isDisabled={networkSymbol === currency && data.length > 0}
|
||||
onChange={event => onGasLimitChange(event.target.value)}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user