1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Gas Timing with Negative attitude should be bold with tooltip (#11772)

This commit is contained in:
David Walsh 2021-08-14 17:46:55 -05:00 committed by GitHub
parent b5baa6c1d1
commit 01fd2a609e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 7 deletions

View File

@ -714,6 +714,9 @@
"editGasTooLowTooltip": { "editGasTooLowTooltip": {
"message": "Your max fee or max priority fee may be low for current market conditions. We don't know when (or if) your transaction will be processed. " "message": "Your max fee or max priority fee may be low for current market conditions. We don't know when (or if) your transaction will be processed. "
}, },
"editGasTooLowWarningTooltip": {
"message": "This lowers your maximum fee but if network traffic increases your transaction may be delayed or fail."
},
"editNonceField": { "editNonceField": {
"message": "Edit Nonce" "message": "Edit Nonce"
}, },

View File

@ -126,7 +126,6 @@ export default function GasTiming({
let text = ''; let text = '';
let attitude = 'positive'; let attitude = 'positive';
let fontWeight = FONT_WEIGHT.NORMAL;
// Anything medium or faster is positive // Anything medium or faster is positive
if ( if (
@ -159,7 +158,6 @@ export default function GasTiming({
customEstimatedTime === 'unknown' || customEstimatedTime === 'unknown' ||
customEstimatedTime?.upperTimeBound === 'unknown' customEstimatedTime?.upperTimeBound === 'unknown'
) { ) {
fontWeight = FONT_WEIGHT.BOLD;
text = unknownProcessingTimeText; text = unknownProcessingTimeText;
} else { } else {
text = t('gasTimingNegative', [ text = t('gasTimingNegative', [
@ -167,16 +165,23 @@ export default function GasTiming({
]); ]);
} }
} else { } else {
text = t('gasTimingNegative', [ text = (
toHumanReadableTime(low.maxWaitTimeEstimate, t), <>
]); {t('gasTimingNegative', [
toHumanReadableTime(low.maxWaitTimeEstimate, t),
])}
<InfoTooltip
position="top"
contentText={t('editGasTooLowWarningTooltip')}
/>
</>
);
} }
} }
return ( return (
<Typography <Typography
variant={TYPOGRAPHY.H7} variant={TYPOGRAPHY.H7}
fontWeight={fontWeight}
className={classNames('gas-timing', { className={classNames('gas-timing', {
[`gas-timing--${attitude}`]: attitude, [`gas-timing--${attitude}`]: attitude,
})} })}

View File

@ -11,6 +11,7 @@
&--negative { &--negative {
color: $error-1; color: $error-1;
font-weight: bold;
} }
.info-tooltip { .info-tooltip {

View File

@ -52,7 +52,7 @@ exports[`FeeCard renders the component with EIP-1559 enabled 2`] = `
class="fee-card__info-tooltip-container" class="fee-card__info-tooltip-container"
> >
<div <div
aria-describedby="tippy-tooltip-6" aria-describedby="tippy-tooltip-7"
class="info-tooltip__tooltip-container" class="info-tooltip__tooltip-container"
data-original-title="null" data-original-title="null"
data-tooltipped="" data-tooltipped=""