1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

remove estimation appearance from edit-gas-popover on non-1559 networks (#11673)

This commit is contained in:
Alex Donesky 2021-07-29 18:29:36 -05:00 committed by GitHub
parent 1135810699
commit 583c115663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -60,6 +60,7 @@ export default function EditGasDisplay({
warning, warning,
gasErrors, gasErrors,
onManualChange, onManualChange,
networkSupports1559,
}) { }) {
const t = useContext(I18nContext); const t = useContext(I18nContext);
@ -112,9 +113,14 @@ export default function EditGasDisplay({
</div> </div>
)} )}
<TransactionTotalBanner <TransactionTotalBanner
total={estimatedMinimumFiat} total={
networkSupports1559
? `~ ${estimatedMinimumFiat}`
: estimatedMaximumNative
}
detail={ detail={
process.env.SHOW_EIP_1559_UI && networkSupports1559 &&
estimatedMaximumFiat !== undefined &&
t('editGasTotalBannerSubtitle', [ t('editGasTotalBannerSubtitle', [
<Typography <Typography
fontWeight={FONT_WEIGHT.BOLD} fontWeight={FONT_WEIGHT.BOLD}
@ -261,4 +267,5 @@ EditGasDisplay.propTypes = {
transaction: PropTypes.object, transaction: PropTypes.object,
gasErrors: PropTypes.object, gasErrors: PropTypes.object,
onManualChange: PropTypes.func, onManualChange: PropTypes.func,
networkSupports1559: PropTypes.boolean,
}; };

View File

@ -5,6 +5,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { useGasFeeInputs } from '../../../hooks/useGasFeeInputs'; import { useGasFeeInputs } from '../../../hooks/useGasFeeInputs';
import { useShouldAnimateGasEstimations } from '../../../hooks/useShouldAnimateGasEstimations'; import { useShouldAnimateGasEstimations } from '../../../hooks/useShouldAnimateGasEstimations';
import { isEIP1559Network } from '../../../ducks/metamask/metamask';
import { import {
GAS_ESTIMATE_TYPES, GAS_ESTIMATE_TYPES,
EDIT_GAS_MODES, EDIT_GAS_MODES,
@ -42,6 +43,7 @@ export default function EditGasPopover({
const t = useContext(I18nContext); const t = useContext(I18nContext);
const dispatch = useDispatch(); const dispatch = useDispatch();
const showSidebar = useSelector((state) => state.appState.sidebar.isOpen); const showSidebar = useSelector((state) => state.appState.sidebar.isOpen);
const networkSupports1559 = useSelector(isEIP1559Network);
const shouldAnimate = useShouldAnimateGasEstimations(); const shouldAnimate = useShouldAnimateGasEstimations();
@ -227,6 +229,7 @@ export default function EditGasPopover({
hasGasErrors={hasGasErrors} hasGasErrors={hasGasErrors}
gasErrors={gasErrors} gasErrors={gasErrors}
onManualChange={onManualChange} onManualChange={onManualChange}
networkSupports1559={networkSupports1559}
{...editGasDisplayProps} {...editGasDisplayProps}
/> />
</> </>

View File

@ -12,7 +12,7 @@ export default function TransactionTotalBanner({
return ( return (
<div className="transaction-total-banner"> <div className="transaction-total-banner">
<Typography color={COLORS.BLACK} variant={TYPOGRAPHY.H1}> <Typography color={COLORS.BLACK} variant={TYPOGRAPHY.H1}>
~ {total} {total}
</Typography> </Typography>
{detail && ( {detail && (
<Typography <Typography