1
0
Fork 0

[MMI] Added code fences to hide emojis just for MMI build (#20754)

* Added code fences to hide emojis just for MMI build

* Added missing code fences

* Added missing code fences
This commit is contained in:
Albert Olivé 2023-09-06 16:18:07 +02:00 committed by GitHub
parent 38876dc450
commit 6c5f24aa66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 15 deletions

View File

@ -7,7 +7,9 @@ import {
TextColor,
TextVariant,
} from '../../../helpers/constants/design-system';
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
import { PRIORITY_LEVEL_ICON_MAP } from '../../../helpers/constants/gas';
///: END:ONLY_INCLUDE_IN
import { useGasFeeContext } from '../../../contexts/gasFee';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { useTransactionEventFragment } from '../../../hooks/useTransactionEventFragment';
@ -35,17 +37,22 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) {
if (!supportsEIP1559 || !estimateUsed || !editEnabled) {
return null;
}
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
let icon = estimateUsed;
///: END:ONLY_INCLUDE_IN
let title = estimateUsed;
if (
estimateUsed === PriorityLevels.high &&
editGasMode === EditGasModes.swaps
) {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon = 'swapSuggested';
///: END:ONLY_INCLUDE_IN
title = 'swapSuggested';
} else if (estimateUsed === PriorityLevels.tenPercentIncreased) {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon = undefined;
///: END:ONLY_INCLUDE_IN
title = 'tenPercentIncreased';
}
@ -66,11 +73,15 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) {
return (
<div className="edit-gas-fee-button">
<button onClick={openEditGasFeeModal} data-testid="edit-gas-fee-button">
{icon && (
<span className="edit-gas-fee-button__icon">
{PRIORITY_LEVEL_ICON_MAP[icon]}
</span>
)}
{
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon && (
<span className="edit-gas-fee-button__icon">
{PRIORITY_LEVEL_ICON_MAP[icon]}
</span>
)
///: END:ONLY_INCLUDE_IN
}
<span className="edit-gas-fee-button__label">{t(title)}</span>
<Icon
name={IconName.ArrowRight}

View File

@ -6,7 +6,9 @@ import {
EditGasModes,
PriorityLevels,
} from '../../../../../shared/constants/gas';
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
import { PRIORITY_LEVEL_ICON_MAP } from '../../../../helpers/constants/gas';
///: END:ONLY_INCLUDE_IN
import { PRIMARY } from '../../../../helpers/constants/common';
import { toHumanReadableTime } from '../../../../helpers/utils/util';
import { useGasFeeContext } from '../../../../contexts/gasFee';
@ -21,23 +23,34 @@ import EditGasToolTip from '../edit-gas-tooltip/edit-gas-tooltip';
import { useGasItemFeeDetails } from './useGasItemFeeDetails';
const getTitleAndIcon = (priorityLevel, editGasMode) => {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
let icon = priorityLevel;
///: END:ONLY_INCLUDE_IN
let title = priorityLevel;
if (priorityLevel === PriorityLevels.dAppSuggested) {
title = 'dappSuggestedShortLabel';
} else if (priorityLevel === PriorityLevels.dappSuggestedHigh) {
title = 'dappSuggestedHighShortLabel';
} else if (priorityLevel === PriorityLevels.tenPercentIncreased) {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon = null;
///: END:ONLY_INCLUDE_IN
title = 'tenPercentIncreased';
} else if (
priorityLevel === PriorityLevels.high &&
editGasMode === EditGasModes.swaps
) {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon = 'swapSuggested';
///: END:ONLY_INCLUDE_IN
title = 'swapSuggested';
}
return { title, icon };
return {
title,
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon,
///: END:ONLY_INCLUDE_IN
};
};
const EditGasItem = ({ priorityLevel }) => {
@ -100,7 +113,12 @@ const EditGasItem = ({ priorityLevel }) => {
}
};
const { title, icon } = getTitleAndIcon(priorityLevel, editGasMode);
const {
title,
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon,
///: END:ONLY_INCLUDE_IN
} = getTitleAndIcon(priorityLevel, editGasMode);
return (
<button
@ -115,13 +133,17 @@ const EditGasItem = ({ priorityLevel }) => {
data-testid={`edit-gas-fee-item-${priorityLevel}`}
>
<span className="edit-gas-item__name">
{icon && (
<span
className={`edit-gas-item__icon edit-gas-item__icon-${priorityLevel}`}
>
{PRIORITY_LEVEL_ICON_MAP[icon]}
</span>
)}
{
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
icon && (
<span
className={`edit-gas-item__icon edit-gas-item__icon-${priorityLevel}`}
>
{PRIORITY_LEVEL_ICON_MAP[icon]}
</span>
)
///: END:ONLY_INCLUDE_IN
}
{t(title)}
</span>
<span