Skip to content

Commit

Permalink
remove estimation appearance from edit-gas-popover on non-1559 networ…
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 authored Jul 29, 2021
1 parent 1135810 commit 583c115
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions ui/components/app/edit-gas-display/edit-gas-display.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function EditGasDisplay({
warning,
gasErrors,
onManualChange,
networkSupports1559,
}) {
const t = useContext(I18nContext);

Expand Down Expand Up @@ -112,9 +113,14 @@ export default function EditGasDisplay({
</div>
)}
<TransactionTotalBanner
total={estimatedMinimumFiat}
total={
networkSupports1559
? `~ ${estimatedMinimumFiat}`
: estimatedMaximumNative
}
detail={
process.env.SHOW_EIP_1559_UI &&
networkSupports1559 &&
estimatedMaximumFiat !== undefined &&
t('editGasTotalBannerSubtitle', [
<Typography
fontWeight={FONT_WEIGHT.BOLD}
Expand Down Expand Up @@ -261,4 +267,5 @@ EditGasDisplay.propTypes = {
transaction: PropTypes.object,
gasErrors: PropTypes.object,
onManualChange: PropTypes.func,
networkSupports1559: PropTypes.boolean,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { useGasFeeInputs } from '../../../hooks/useGasFeeInputs';
import { useShouldAnimateGasEstimations } from '../../../hooks/useShouldAnimateGasEstimations';

import { isEIP1559Network } from '../../../ducks/metamask/metamask';
import {
GAS_ESTIMATE_TYPES,
EDIT_GAS_MODES,
Expand Down Expand Up @@ -42,6 +43,7 @@ export default function EditGasPopover({
const t = useContext(I18nContext);
const dispatch = useDispatch();
const showSidebar = useSelector((state) => state.appState.sidebar.isOpen);
const networkSupports1559 = useSelector(isEIP1559Network);

const shouldAnimate = useShouldAnimateGasEstimations();

Expand Down Expand Up @@ -227,6 +229,7 @@ export default function EditGasPopover({
hasGasErrors={hasGasErrors}
gasErrors={gasErrors}
onManualChange={onManualChange}
networkSupports1559={networkSupports1559}
{...editGasDisplayProps}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function TransactionTotalBanner({
return (
<div className="transaction-total-banner">
<Typography color={COLORS.BLACK} variant={TYPOGRAPHY.H1}>
~ {total}
{total}
</Typography>
{detail && (
<Typography
Expand Down

0 comments on commit 583c115

Please sign in to comment.