From c86cbf5df2d8d3eb4cd9f5cd8f82fb45d2b8930c Mon Sep 17 00:00:00 2001 From: Dhruv <79097544+dhruvv173@users.noreply.github.com> Date: Wed, 12 Jul 2023 22:12:24 +0530 Subject: [PATCH] Replacing deprecated constants (#19858) --- .../detected-token-aggregators.js | 13 +++++-------- .../detected-token-aggregators.stories.js | 6 +++--- .../detected-token-details.js | 8 ++++---- .../detected-token-details.stories.js | 2 +- .../detected-token-values/detected-token-values.js | 7 +++---- 5 files changed, 16 insertions(+), 20 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 7052eabbc..ac3af6bff 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 @@ -3,14 +3,12 @@ import PropTypes from 'prop-types'; import { useI18nContext } from '../../../../hooks/useI18nContext'; -import Box from '../../../ui/box'; -import Button from '../../../ui/button'; import { - DISPLAY, + Display, FontWeight, TextVariant, } from '../../../../helpers/constants/design-system'; -import { Text } from '../../../component-library'; +import { Text, Box, ButtonLink } from '../../../component-library'; const NUMBER_OF_AGGREGATORS_TO_DISPLAY = 2; @@ -21,7 +19,7 @@ const DetectedTokenAggregators = ({ aggregators }) => { const [displayMore, setDisplayMore] = useState(false); return ( - + {t('fromTokenLists', [ numOfHiddenAggregators > 0 && !displayMore ? ( @@ -34,14 +32,13 @@ const DetectedTokenAggregators = ({ aggregators }) => { {`${aggregators .slice(0, NUMBER_OF_AGGREGATORS_TO_DISPLAY) .join(', ')}`} - + ) : ( { return ( - + diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.js index 7bd87f5b4..3fb321963 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.js @@ -2,12 +2,12 @@ import React from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; -import Box from '../../../ui/box'; +import { Box } from '../../../component-library'; import Identicon from '../../../ui/identicon'; import DetectedTokenValues from '../detected-token-values/detected-token-values'; import DetectedTokenAddress from '../detected-token-address/detected-token-address'; import DetectedTokenAggregators from '../detected-token-aggregators/detected-token-aggregators'; -import { DISPLAY } from '../../../../helpers/constants/design-system'; +import { Display } from '../../../../helpers/constants/design-system'; import { getTokenList } from '../../../../selectors'; const DetectedTokenDetails = ({ @@ -20,7 +20,7 @@ const DetectedTokenDetails = ({ return ( @@ -30,7 +30,7 @@ const DetectedTokenDetails = ({ diameter={40} /> diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js index 360f20e93..68dcdc8a2 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js @@ -7,7 +7,7 @@ export default { argTypes: { token: { control: 'object' }, - handleTokenSelection: { control: 'func' }, + handleTokenSelection: { action: 'handleTokenSelection' }, tokensListDetected: { control: 'array' }, }, args: { diff --git a/ui/components/app/detected-token/detected-token-values/detected-token-values.js b/ui/components/app/detected-token/detected-token-values/detected-token-values.js index 67d16c946..6d1a95470 100644 --- a/ui/components/app/detected-token/detected-token-values/detected-token-values.js +++ b/ui/components/app/detected-token/detected-token-values/detected-token-values.js @@ -2,18 +2,17 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; -import Box from '../../../ui/box'; import CheckBox from '../../../ui/check-box'; import { - DISPLAY, + Display, TextColor, TextVariant, } from '../../../../helpers/constants/design-system'; import { useTokenTracker } from '../../../../hooks/useTokenTracker'; import { useTokenFiatAmount } from '../../../../hooks/useTokenFiatAmount'; import { getUseCurrencyRateCheck } from '../../../../selectors'; -import { Text } from '../../../component-library'; +import { Text, Box } from '../../../component-library'; const DetectedTokenValues = ({ token, @@ -44,7 +43,7 @@ const DetectedTokenValues = ({ }; return ( - + {`${balanceString || '0'} ${token.symbol}`}