Skip to content

Commit

Permalink
Updating Text import paths in ui folder
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Jul 18, 2023
1 parent 8f8613a commit 23696d1
Show file tree
Hide file tree
Showing 28 changed files with 83 additions and 103 deletions.
2 changes: 1 addition & 1 deletion test/e2e/tests/custom-token-add-approve.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Create token, approve token and approve token without gas', function (

const defaultSpendingCap = await driver.findElement({
text: '7 TST',
css: '.box--flex-direction-row > h6',
css: '.mm-box > h6',
});

assert.equal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ exports[`CustomSpendingCap should match snapshot 1`] = `
class="mm-box form-field__heading-title mm-box--display-flex mm-box--align-items-baseline"
>
<h6
class="box mm-text mm-text--body-sm-bold box--display-inline-block box--flex-direction-row box--color-text-default"
for="custom-spending-cap"
tag="label"
class="mm-box mm-text mm-text--body-sm-bold mm-box--display-inline-block mm-box--color-text-default"
>
Custom spending cap
</h6>
Expand Down Expand Up @@ -76,13 +74,13 @@ exports[`CustomSpendingCap should match snapshot 1`] = `
class="box custom-spending-cap__description box--flex-direction-row"
>
<h6
class="box mm-text mm-text--body-sm box--padding-top-2 box--flex-direction-row box--color-text-default"
class="mm-box mm-text mm-text--body-sm mm-box--padding-top-2 mm-box--color-text-default"
>
<span>
This allows the third party to spend
<h6
class="box mm-text custom-spending-cap__input-value-and-token-name mm-text--body-sm-bold box--flex-direction-row box--color-text-default"
class="mm-box mm-text custom-spending-cap__input-value-and-token-name mm-text--body-sm-bold mm-box--color-text-default"
>
7
Expand Down
4 changes: 2 additions & 2 deletions ui/components/app/custom-spending-cap/custom-spending-cap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { addHexPrefix } from 'ethereumjs-util';
import { I18nContext } from '../../../contexts/i18n';
import Box from '../../ui/box';
import FormField from '../../ui/form-field';
import { ButtonLink, Icon, IconName } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { ButtonLink, Icon, IconName, Text } from '../../component-library';

import {
AlignItems,
TextAlign,
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ui/box/box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
FlexWrap,
} from '../../../helpers/constants/design-system';

import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

import Box from './box';

Expand Down
3 changes: 1 addition & 2 deletions ui/components/ui/callout/callout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import classnames from 'classnames';
import InfoIconInverted from '../icon/info-icon-inverted.component';
import { Severity, TextColor } from '../../../helpers/constants/design-system';
import { MILLISECOND } from '../../../../shared/constants/time';
import { ButtonIcon, IconName, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { ButtonIcon, IconName, IconSize, Text } from '../../component-library';

/**
* @deprecated `<Callout />` has been deprecated in favor of the `<BannerAlert />`
Expand Down
4 changes: 2 additions & 2 deletions ui/components/ui/callout/callout.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
SEVERITIES,
TextVariant,
} from '../../../helpers/constants/design-system';
import Box from '../box';
import { Text } from '../../component-library/text/deprecated';

import { Text, Box } from '../../component-library';
import Callout from './callout';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import Box from '../box/box';
import ActionableMessage from '../actionable-message/actionable-message';
import { getCurrentChainId } from '../../../selectors';
import { getCompletedOnboarding } from '../../../ducks/metamask/metamask';
import { Icon, IconName, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { Icon, IconName, IconSize, Text } from '../../component-library';

export default function DeprecatedTestNetworks() {
const currentChainID = useSelector(getCurrentChainId);
Expand Down
10 changes: 7 additions & 3 deletions ui/components/ui/editable-label/editable-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ import {
TextVariant,
} from '../../../helpers/constants/design-system';
import { getAccountNameErrorMessage } from '../../../helpers/utils/accounts';
import { ButtonIcon, FormTextField, IconName } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import Box from '../box/box';
import {
ButtonIcon,
FormTextField,
IconName,
Text,
Box,
} from '../../component-library';

export default class EditableLabel extends Component {
static propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import {
AlignItems,
BorderColor,
BorderRadius,
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
JustifyContent,
TextVariant,
} from '../../../helpers/constants/design-system';
import Box from '../box/box';
import { ButtonSecondary } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { ButtonSecondary, Text, Box } from '../../component-library';

function ExportTextContainer({ text = '', onClickCopy = null }) {
const ONE_MINUTE = 1000 * 60;
Expand All @@ -22,18 +20,18 @@ function ExportTextContainer({ text = '', onClickCopy = null }) {

return (
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
justifyContent={JustifyContent.center}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
alignItems={AlignItems.center}
borderColor={BorderColor.borderDefault}
borderRadius={BorderRadius.MD}
padding={4}
gap={4}
>
<Text
display={DISPLAY.FLEX}
justifyContent={JustifyContent.CENTER}
display={Display.Flex}
justifyContent={JustifyContent.center}
className="notranslate"
variant={TextVariant.bodyLgMedium}
data-testid="srp_text"
Expand Down
10 changes: 3 additions & 7 deletions ui/components/ui/form-field/form-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {

import NumericInput from '../numeric-input/numeric-input.component';
import InfoTooltip from '../info-tooltip/info-tooltip';
import { Box } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { Text, Box } from '../../component-library';

/**
* @deprecated The `<FormField />` component has been deprecated in favor of the new `<FormTextField>` component from the component-library.
Expand Down Expand Up @@ -70,10 +69,8 @@ export default function FormField({
{TitleTextCustomComponent ||
(titleText && (
<Text
tag="label"
htmlFor={id}
variant={TextVariant.bodySmBold}
as="h6"
variant={TextVariant.bodySmBold}
display={Display.InlineBlock}
>
{titleText}
Expand All @@ -82,9 +79,8 @@ export default function FormField({
{TitleUnitCustomComponent ||
(titleUnit && (
<Text
tag={TextVariant.bodySm}
variant={TextVariant.bodySm}
as="h6"
variant={TextVariant.bodySm}
color={TextColor.textAlternative}
display={Display.InlineBlock}
>
Expand Down
3 changes: 1 addition & 2 deletions ui/components/ui/form-field/form-field.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import React, { useState } from 'react';
import Tooltip from '../tooltip';

import { Icon, IconName } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { Icon, IconName, Text } from '../../component-library';
import { AlignItems } from '../../../helpers/constants/design-system';
import README from './README.mdx';
import FormField from '.';
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ui/icon-button/icon-button.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';
import { TextVariant } from '../../../helpers/constants/design-system';
import Tooltip from '../tooltip/tooltip';

Expand Down
4 changes: 1 addition & 3 deletions ui/components/ui/logo/logo.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import PropTypes from 'prop-types';
import React from 'react';

import { BackgroundColor } from '../../../helpers/constants/design-system';
import { Text } from '../../component-library/text/deprecated';
import { Text, Box } from '../../component-library';

import Card from '../card';
import Box from '../box';

import LogoLedger from './logo-ledger';
import LogoQRBased from './logo-qr-based';
Expand All @@ -16,7 +15,6 @@ import README from './README.mdx';

export default {
title: 'Components/UI/Logo',

parameters: {
docs: {
page: README,
Expand Down
3 changes: 1 addition & 2 deletions ui/components/ui/menu/menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

import { Icon, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { Icon, IconSize, Text } from '../../component-library';
import { TextVariant } from '../../../helpers/constants/design-system';

const MenuItem = React.forwardRef(
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ui/metafox-logo/metafox-logo.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';
import MetaFoxLogo from '.';

export default {
Expand Down
3 changes: 1 addition & 2 deletions ui/components/ui/new-network-info/new-network-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import { IMPORT_TOKEN_ROUTE } from '../../../helpers/constants/routes';
import Chip from '../chip/chip';
import { setFirstTimeUsedNetwork } from '../../../store/actions';
import { NETWORK_TYPES } from '../../../../shared/constants/network';
import { Icon, IconName } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { Icon, IconName, Text } from '../../component-library';
import { getNetworkLabelKey } from '../../../helpers/utils/i18n-helper';

const NewNetworkInfo = () => {
Expand Down
21 changes: 6 additions & 15 deletions ui/components/ui/nft-info/nft-info.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { I18nContext } from '../../../contexts/i18n';
import Box from '../box';
import {
BackgroundColor,
DISPLAY,
Display,
TextColor,
TextVariant,
} from '../../../helpers/constants/design-system';
import Identicon from '../identicon';
import Button from '../button';
import { Text } from '../../component-library/text/deprecated';
import { Text, Button, Box, BUTTON_VARIANT } from '../../component-library';

export default function NftInfo({ assetName, tokenAddress, tokenId }) {
const t = useContext(I18nContext);

return (
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
className="nft-info"
backgroundColor={BackgroundColor.backgroundAlternative}
>
<Box display={DISPLAY.FLEX} className="nft-info__content">
<Box display={Display.Flex} className="nft-info__content">
<Box margin={4}>
<Identicon address={tokenAddress} diameter={24} />
</Box>
Expand All @@ -40,15 +38,8 @@ export default function NftInfo({ assetName, tokenAddress, tokenId }) {
</Box>
</Box>
<Box marginTop={4} marginRight={4}>
<Button className="nft-info__button" type="link">
<Text
variant={TextVariant.bodySm}
as="h6"
marginTop={0}
color={TextColor.primaryDefault}
>
{t('view')}
</Text>
<Button className="nft-info__button" variant={BUTTON_VARIANT.LINK}>
{t('view')}
</Button>
</Box>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ui/numeric-input/numeric-input.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TextVariant,
} from '../../../helpers/constants/design-system';
import { DECIMAL_REGEX } from '../../../../shared/constants/tokens';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

export default function NumericInput({
detailText = '',
Expand Down
9 changes: 7 additions & 2 deletions ui/components/ui/popover/popover.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ import {
BLOCK_SIZES,
} from '../../../helpers/constants/design-system';

import { ButtonIcon, Icon, IconName, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import {
ButtonIcon,
Icon,
IconName,
IconSize,
Text,
} from '../../component-library';

const defaultHeaderProps = {
padding: [6, 4, 4],
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ui/radio-group/radio-group.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { I18nContext } from '../../../contexts/i18n';
import { Color, TextVariant } from '../../../helpers/constants/design-system';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

function Connector({ isFirst, isLast }) {
if (isFirst) {
Expand Down
30 changes: 18 additions & 12 deletions ui/components/ui/review-spending-cap/review-spending-cap.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { I18nContext } from '../../../contexts/i18n';
import Box from '../box';
import Tooltip from '../tooltip';
import { ButtonLink, Icon, IconName, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import {
ButtonLink,
Icon,
IconName,
IconSize,
Text,
Box,
} from '../../component-library';

import {
AlignItems,
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
TextVariant,
TextAlign,
Size,
Expand Down Expand Up @@ -37,30 +43,30 @@ export default function ReviewSpendingCap({
paddingTop={4}
paddingRight={4}
paddingLeft={4}
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.flexStart}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
backgroundColor={BackgroundColor.backgroundAlternative}
gap={1}
>
<Box
flexDirection={FLEX_DIRECTION.ROW}
display={DISPLAY.FLEX}
flexDirection={FlexDirection.Row}
display={Display.Flex}
alignItems={AlignItems.center}
className="review-spending-cap__heading"
>
<Box
flexDirection={FLEX_DIRECTION.ROW}
flexDirection={FlexDirection.Row}
className="review-spending-cap__heading-title"
>
<Text
variant={TextVariant.bodySmBold}
as="h6"
display={DISPLAY.INLINE_BLOCK}
display={Display.InlineBlock}
>
{t('dappRequestedSpendingCap')}
</Text>
<Box marginLeft={2} display={DISPLAY.INLINE_BLOCK}>
<Box marginLeft={2} display={Display.InlineBlock}>
<Tooltip
interactive
position="top"
Expand Down
Loading

0 comments on commit 23696d1

Please sign in to comment.