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

Update copy in dapp suggested gas fee tooltip to: "Edit to use MetaMask's recommended gas fee based on the latest block." #11952 (#11986)

* Change the [domain] suggested gas fee (i) to Estimated gas fee (i)
Change that line's color from orange to black
Under that line, add Site suggested in italics in gray.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* liinter fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
This commit is contained in:
Akintayo A. Olusegun 2021-09-01 18:02:01 +00:00 committed by GitHub
parent 8ffebb294b
commit aba396870a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 19 deletions

View File

@ -2515,9 +2515,8 @@
"transactionCreated": { "transactionCreated": {
"message": "Transaction created with a value of $1 at $2." "message": "Transaction created with a value of $1 at $2."
}, },
"transactionDetailDappGasHeading": { "transactionDetailDappGasMoreInfo": {
"message": "$1 suggested gas fee", "message": "Site suggested"
"description": "$1 represents a dapp origin"
}, },
"transactionDetailDappGasTooltip": { "transactionDetailDappGasTooltip": {
"message": "Edit to use MetaMask's recommended gas fee based on the latest block." "message": "Edit to use MetaMask's recommended gas fee based on the latest block."

View File

@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import { import {
COLORS, COLORS,
FONT_WEIGHT, FONT_WEIGHT,
FONT_STYLE,
TEXT_ALIGN, TEXT_ALIGN,
TYPOGRAPHY, TYPOGRAPHY,
} from '../../../helpers/constants/design-system'; } from '../../../helpers/constants/design-system';
@ -18,6 +19,7 @@ export default function Typography({
tag, tag,
children, children,
fontWeight = 'normal', fontWeight = 'normal',
fontStyle = 'normal',
align, align,
boxProps = {}, boxProps = {},
}) { }) {
@ -26,6 +28,7 @@ export default function Typography({
className, className,
`typography--${variant}`, `typography--${variant}`,
`typography--weight-${fontWeight}`, `typography--weight-${fontWeight}`,
`typography--style-${fontStyle}`,
{ {
[`typography--align-${align}`]: Boolean(align), [`typography--align-${align}`]: Boolean(align),
[`typography--color-${color}`]: Boolean(color), [`typography--color-${color}`]: Boolean(color),
@ -61,6 +64,7 @@ Typography.propTypes = {
...Box.propTypes, ...Box.propTypes,
}), }),
fontWeight: PropTypes.oneOf(Object.values(FONT_WEIGHT)), fontWeight: PropTypes.oneOf(Object.values(FONT_WEIGHT)),
fontStyle: PropTypes.oneOf(Object.values(FONT_STYLE)),
tag: PropTypes.oneOf([ tag: PropTypes.oneOf([
'p', 'p',
'h1', 'h1',
@ -73,5 +77,6 @@ Typography.propTypes = {
'div', 'div',
'dt', 'dt',
'dd', 'dd',
'i',
]), ]),
}; };

View File

@ -26,6 +26,12 @@
} }
} }
@each $style in design-system.$font-style {
&--style-#{$style} {
font-style: $style;
}
}
@each $alignment in design-system.$text-align { @each $alignment in design-system.$text-align {
&--align-#{$alignment} { &--align-#{$alignment} {
text-align: $alignment; text-align: $alignment;

View File

@ -70,3 +70,4 @@ $directions: top, right, bottom, left;
$display: block, grid, flex, inline-block, inline-grid, inline-flex, list-item; $display: block, grid, flex, inline-block, inline-grid, inline-flex, list-item;
$text-align: left, right, center, justify, end; $text-align: left, right, center, justify, end;
$font-weight: bold, normal, 100, 200, 300, 400, 500, 600, 700, 800, 900; $font-weight: bold, normal, 100, 200, 300, 400, 500, 600, 700, 800, 900;
$font-style: normal, italic, oblique;

View File

@ -10,6 +10,7 @@ export const COLORS = {
UI3: 'ui-3', UI3: 'ui-3',
UI4: 'ui-4', UI4: 'ui-4',
BLACK: 'black', BLACK: 'black',
GRAY: 'gray',
WHITE: 'white', WHITE: 'white',
PRIMARY1: 'primary-1', PRIMARY1: 'primary-1',
PRIMARY2: 'primary-2', PRIMARY2: 'primary-2',
@ -156,6 +157,12 @@ export const FONT_WEIGHT = {
900: 900, 900: 900,
}; };
export const FONT_STYLE = {
ITALIC: 'italic',
NORMAL: 'normal',
OBLIQUE: 'oblique',
};
export const SEVERITIES = { export const SEVERITIES = {
DANGER: 'danger', DANGER: 'danger',
WARNING: 'warning', WARNING: 'warning',

View File

@ -9,7 +9,6 @@ import {
hexToDecimal, hexToDecimal,
hexWEIToDecGWEI, hexWEIToDecGWEI,
} from '../../helpers/utils/conversions.util'; } from '../../helpers/utils/conversions.util';
import { getURLHostName } from '../../helpers/utils/util';
import { import {
CONFIRM_TRANSACTION_ROUTE, CONFIRM_TRANSACTION_ROUTE,
DEFAULT_ROUTE, DEFAULT_ROUTE,
@ -37,7 +36,11 @@ import InfoTooltip from '../../components/ui/info-tooltip/info-tooltip';
import LoadingHeartBeat from '../../components/ui/loading-heartbeat'; import LoadingHeartBeat from '../../components/ui/loading-heartbeat';
import GasTiming from '../../components/app/gas-timing/gas-timing.component'; import GasTiming from '../../components/app/gas-timing/gas-timing.component';
import { COLORS } from '../../helpers/constants/design-system'; import {
COLORS,
FONT_STYLE,
TYPOGRAPHY,
} from '../../helpers/constants/design-system';
import { import {
disconnectGasFeeEstimatePoller, disconnectGasFeeEstimatePoller,
getGasFeeEstimatesAndStartPolling, getGasFeeEstimatesAndStartPolling,
@ -45,6 +48,8 @@ import {
removePollingTokenFromAppState, removePollingTokenFromAppState,
} from '../../store/actions'; } from '../../store/actions';
import Typography from '../../components/ui/typography/typography';
const renderHeartBeatIfNotInTest = () => const renderHeartBeatIfNotInTest = () =>
process.env.IN_TEST === 'true' ? null : <LoadingHeartBeat />; process.env.IN_TEST === 'true' ? null : <LoadingHeartBeat />;
@ -401,9 +406,7 @@ export default class ConfirmTransactionBase extends Component {
detailTitle={ detailTitle={
txData.dappSuggestedGasFees ? ( txData.dappSuggestedGasFees ? (
<> <>
{t('transactionDetailDappGasHeading', [ {t('transactionDetailGasHeading')}
getURLHostName(txData?.origin),
])}
<InfoTooltip <InfoTooltip
contentText={t('transactionDetailDappGasTooltip')} contentText={t('transactionDetailDappGasTooltip')}
position="top" position="top"
@ -441,9 +444,7 @@ export default class ConfirmTransactionBase extends Component {
</> </>
) )
} }
detailTitleColor={ detailTitleColor={COLORS.BLACK}
txData.dappSuggestedGasFees ? COLORS.SECONDARY1 : COLORS.BLACK
}
detailText={ detailText={
<div className="confirm-page-container-content__currency-container"> <div className="confirm-page-container-content__currency-container">
{renderHeartBeatIfNotInTest()} {renderHeartBeatIfNotInTest()}
@ -482,15 +483,28 @@ export default class ConfirmTransactionBase extends Component {
</div>, </div>,
])} ])}
subTitle={ subTitle={
<GasTiming <>
maxPriorityFeePerGas={hexWEIToDecGWEI( {txData.dappSuggestedGasFees ? (
maxPriorityFeePerGas || <Typography
txData.txParams.maxPriorityFeePerGas, variant={TYPOGRAPHY.H7}
fontStyle={FONT_STYLE.ITALIC}
color={COLORS.GRAY}
>
{t('transactionDetailDappGasMoreInfo')}
</Typography>
) : (
''
)} )}
maxFeePerGas={hexWEIToDecGWEI( <GasTiming
maxFeePerGas || txData.txParams.maxFeePerGas, maxPriorityFeePerGas={hexWEIToDecGWEI(
)} maxPriorityFeePerGas ||
/> txData.txParams.maxPriorityFeePerGas,
)}
maxFeePerGas={hexWEIToDecGWEI(
maxFeePerGas || txData.txParams.maxFeePerGas,
)}
/>
</>
} }
/>, />,
<TransactionDetailItem <TransactionDetailItem