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