From 9967b50015dc6c9857c72d137056ebc23f64b0af Mon Sep 17 00:00:00 2001 From: Harsh Shukla <125105825+PrgrmrHarshShukla@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:56:58 +0530 Subject: [PATCH] Worked on #17670 & #18714 for 7 files. (#18789) Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- .../detected-token-aggregators.js | 31 ++++----- .../detected-token-ignored-popover.js | 13 ++-- .../edit-gas-fee-button.js | 24 +++---- .../edit-gas-fee-popover.js | 13 ++-- .../edit-gas-tooltip/edit-gas-tooltip.js | 58 +++++++++------- .../contract-details-modal.js | 69 ++++++++++--------- .../secure-your-wallet/secure-your-wallet.js | 62 +++++++++-------- 7 files changed, 143 insertions(+), 127 deletions(-) diff --git a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js index b2865d2ae..7052eabbc 100644 --- a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js +++ b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js @@ -5,12 +5,12 @@ import { useI18nContext } from '../../../../hooks/useI18nContext'; import Box from '../../../ui/box'; import Button from '../../../ui/button'; -import Typography from '../../../ui/typography/typography'; import { DISPLAY, - FONT_WEIGHT, - TypographyVariant, + FontWeight, + TextVariant, } from '../../../../helpers/constants/design-system'; +import { Text } from '../../../component-library'; const NUMBER_OF_AGGREGATORS_TO_DISPLAY = 2; @@ -22,15 +22,13 @@ const DetectedTokenAggregators = ({ aggregators }) => { return ( - + {t('fromTokenLists', [ numOfHiddenAggregators > 0 && !displayMore ? ( - {`${aggregators @@ -44,18 +42,19 @@ const DetectedTokenAggregators = ({ aggregators }) => { > {t('plusXMore', [numOfHiddenAggregators])} - + ) : ( - {`${aggregators.join(', ')}.`} - + ), ])} - + ); }; diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js index 2a2566109..b32428c18 100644 --- a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js +++ b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js @@ -5,8 +5,8 @@ import { useI18nContext } from '../../../../hooks/useI18nContext'; import Popover from '../../../ui/popover'; import Button from '../../../ui/button'; -import Typography from '../../../ui/typography/typography'; -import { TypographyVariant } from '../../../../helpers/constants/design-system'; +import { TextVariant } from '../../../../helpers/constants/design-system'; +import { Text } from '../../../component-library'; const DetectedTokenIgnoredPopover = ({ partiallyIgnoreDetectedTokens, @@ -48,9 +48,10 @@ const DetectedTokenIgnoredPopover = ({ })} footer={footer} > - + ); }; diff --git a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js index e3ee7fa00..70fb157e1 100644 --- a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js +++ b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js @@ -5,7 +5,7 @@ import { EditGasModes, PriorityLevels } from '../../../../shared/constants/gas'; import { Color, TextColor, - TypographyVariant, + TextVariant, } from '../../../helpers/constants/design-system'; import { PRIORITY_LEVEL_ICON_MAP } from '../../../helpers/constants/gas'; import { useGasFeeContext } from '../../../contexts/gasFee'; @@ -13,8 +13,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import { useTransactionEventFragment } from '../../../hooks/useTransactionEventFragment'; import { useTransactionModalContext } from '../../../contexts/transaction-modal'; import InfoTooltip from '../../ui/info-tooltip/info-tooltip'; -import Typography from '../../ui/typography/typography'; -import { Icon, IconName, IconSize } from '../../component-library'; +import { Icon, IconName, IconSize, Text } from '../../component-library'; export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { const t = useI18nContext(); @@ -87,22 +86,23 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { contentText={
{transaction?.origin && ( - {t('dappSuggestedTooltip', [transaction.origin])} - + )} - + {t('maxBaseFee')} {maxFeePerGas} - - + + {t('maxPriorityFee')} {maxPriorityFeePerGas} - - + + {t('gasLimit')} {gasLimit} - +
} position="top" diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js b/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js index 935bf4e2b..d057f042b 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js @@ -6,16 +6,16 @@ import { useTransactionModalContext } from '../../../contexts/transaction-modal' import Box from '../../ui/box'; import ErrorMessage from '../../ui/error-message'; import Popover from '../../ui/popover'; -import Typography from '../../ui/typography/typography'; import { TextColor, - TypographyVariant, + TextVariant, } from '../../../helpers/constants/design-system'; import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../helpers/constants/error-keys'; import { useGasFeeContext } from '../../../contexts/gasFee'; import AppLoadingSpinner from '../app-loading-spinner'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; +import { Text } from '../../component-library'; import EditGasItem from './edit-gas-item'; import NetworkStatistics from './network-statistics'; @@ -84,12 +84,13 @@ const EditGasFeePopover = () => { - {t('learnMoreAboutGas', [ { {t('learnMore')} , ])} - + diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.js b/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.js index 685354471..2d700e3c7 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.js +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.js @@ -5,13 +5,13 @@ import { PriorityLevels, } from '../../../../../shared/constants/gas'; import { - FONT_WEIGHT, + FontWeight, TextColor, - TypographyVariant, + TextVariant, } from '../../../../helpers/constants/design-system'; import { isMetamaskSuggestedGasEstimate } from '../../../../helpers/utils/gas'; import { roundToDecimalPlacesRemovingExtraZeroes } from '../../../../helpers/utils/util'; -import Typography from '../../../ui/typography'; +import { Text } from '../../../component-library'; const EditGasToolTip = ({ editGasMode, @@ -107,43 +107,47 @@ const EditGasToolTip = ({ ) : null} {toolTipMessage && (
- + {toolTipMessage} - +
)} {priorityLevel === PriorityLevels.custom || estimateGreaterThanGasUse ? null : (
- {t('maxBaseFee')} - + {maxFeePerGas && ( - {roundToDecimalPlacesRemovingExtraZeroes(maxFeePerGas, 4)} - + )}
- {t('priorityFeeProperCase')} - + {maxPriorityFeePerGas && ( - @@ -151,25 +155,27 @@ const EditGasToolTip = ({ maxPriorityFeePerGas, 4, )} - + )}
- {t('gasLimit')} - + {gasLimit && ( - {roundToDecimalPlacesRemovingExtraZeroes(gasLimit, 4)} - + )}
diff --git a/ui/components/app/modals/contract-details-modal/contract-details-modal.js b/ui/components/app/modals/contract-details-modal/contract-details-modal.js index 3316ff588..e6250a280 100644 --- a/ui/components/app/modals/contract-details-modal/contract-details-modal.js +++ b/ui/components/app/modals/contract-details-modal/contract-details-modal.js @@ -9,10 +9,9 @@ import { useI18nContext } from '../../../../hooks/useI18nContext'; import Identicon from '../../../ui/identicon'; import { ellipsify } from '../../../../pages/send/send.utils'; import Popover from '../../../ui/popover'; -import Typography from '../../../ui/typography'; import { - FONT_WEIGHT, - TypographyVariant, + FontWeight, + TextVariant, DISPLAY, Size, BorderStyle, @@ -25,7 +24,7 @@ import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'; import { getAddressBookEntry } from '../../../../selectors'; import { TokenStandard } from '../../../../../shared/constants/transaction'; import NftCollectionImage from '../../../ui/nft-collection-image/nft-collection-image'; -import { ButtonIcon, IconName } from '../../../component-library'; +import { ButtonIcon, IconName, Text } from '../../../component-library'; export default function ContractDetailsModal({ onClose, @@ -62,32 +61,35 @@ export default function ContractDetailsModal({ paddingLeft={4} className="contract-details-modal__content" > - {t('contractTitle')} - - + {t('contractDescription')} - + {!isContractRequestingSignature && ( <> - {nft ? t('contractNFT') : t('contractToken')} - + )} - {tokenName || ellipsify(tokenAddress)} - + {tokenName && ( - {ellipsify(tokenAddress)} - + )} )} - + - {addressBookEntry?.data?.name || ellipsify(toAddress)} - + {addressBookEntry?.data?.name && ( - {ellipsify(toAddress)} - + )} - {t('seedPhraseIntroTitle')} - + - {t('seedPhraseIntroTitleCopy')} - +