From 81f274303ecb861ca9006327cd346166f1119fe5 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Sun, 1 Aug 2021 08:09:53 -0500 Subject: [PATCH] EIP-1559 - Only show advanced form toggle when radio buttons are present (#11713) --- .../edit-gas-display.component.js | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/ui/components/app/edit-gas-display/edit-gas-display.component.js b/ui/components/app/edit-gas-display/edit-gas-display.component.js index 1ac6a810d..eee8904cc 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.component.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.component.js @@ -80,6 +80,11 @@ export default function EditGasDisplay({ const networkSupports1559 = useSelector(isEIP1559Network); const showTopError = balanceError; + const showRadioButtons = + networkSupports1559 && + !requireDappAcknowledgement && + ![EDIT_GAS_MODES.SPEED_UP, EDIT_GAS_MODES.CANCEL].includes(mode); + let errorKey; if (balanceError) { errorKey = 'insufficientFunds'; @@ -163,35 +168,32 @@ export default function EditGasDisplay({ {t('gasDisplayAcknowledgeDappButtonText')} )} - {networkSupports1559 && - !requireDappAcknowledgement && - ![EDIT_GAS_MODES.SPEED_UP, EDIT_GAS_MODES.CANCEL].includes(mode) && ( - - )} - {!requireDappAcknowledgement && ( + {showRadioButtons && ( + + )} + {!requireDappAcknowledgement && showRadioButtons && (