Skip to content

Commit

Permalink
Merge branch 'develop' into 17191/onboarding-unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmashuang authored Feb 4, 2023
2 parents 212f686 + 678ad63 commit 2c50a7b
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 203 deletions.
1 change: 0 additions & 1 deletion development/ts-migration-dashboard/files-to-convert.json
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@
"ui/components/ui/icon/icon-eye.js",
"ui/components/ui/icon/icon-import.js",
"ui/components/ui/icon/icon-plus.js",
"ui/components/ui/icon/icon-speech-bubbles.js",
"ui/components/ui/icon/icon-token-search.js",
"ui/components/ui/icon/icon.stories.js",
"ui/components/ui/icon/info-icon-inverted.component.js",
Expand Down
8 changes: 3 additions & 5 deletions ui/components/app/account-menu/account-menu.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
} from '../../../helpers/constants/routes';
import TextField from '../../ui/text-field';
import IconCheck from '../../ui/icon/icon-check';
import IconSpeechBubbles from '../../ui/icon/icon-speech-bubbles';
import IconConnect from '../../ui/icon/icon-connect';
import IconCog from '../../ui/icon/icon-cog';
import IconPlus from '../../ui/icon/icon-plus';
Expand All @@ -41,6 +40,8 @@ import IconImport from '../../ui/icon/icon-import';
import Button from '../../ui/button';
import SearchIcon from '../../ui/icon/search-icon';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
import { Icon, ICON_NAMES } from '../../component-library';
import { Color } from '../../../helpers/constants/design-system';
import KeyRingLabel from './keyring-label';

export function AccountMenuItem(props) {
Expand Down Expand Up @@ -460,10 +461,7 @@ export default class AccountMenu extends Component {
global.platform.openTab({ url: supportLink });
}}
icon={
<IconSpeechBubbles
color="var(--color-icon-alternative)"
ariaLabel={supportText}
/>
<Icon name={ICON_NAMES.MESSAGES} color={Color.iconAlternative} />
}
text={supportText}
/>
Expand Down
20 changes: 10 additions & 10 deletions ui/components/app/flask/copyable/copyable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../../ui/box';
import IconCopied from '../../../ui/icon/icon-copied';
import IconCopy from '../../../ui/icon/icon-copy';
import Typography from '../../../ui/typography';
import {
AlignItems,
Expand All @@ -13,8 +11,10 @@ import {
TypographyVariant,
BackgroundColor,
TextColor,
Color,
} from '../../../../helpers/constants/design-system';
import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard';
import { Icon, ICON_NAMES, ICON_SIZES } from '../../../component-library';

export const Copyable = ({ text }) => {
const [copied, handleCopy] = useCopyToClipboard();
Expand Down Expand Up @@ -46,17 +46,17 @@ export const Copyable = ({ text }) => {
marginBottom={1}
>
{copied ? (
<IconCopied
color="var(--color-icon-alternative)"
className="copyable__icon"
size={18}
<Icon
name={ICON_NAMES.COPY_SUCCESS}
size={ICON_SIZES.LG}
color={Color.iconAlternative}
/>
) : (
<IconCopy
className="copyable__icon"
color="var(--color-icon-alternative)"
<Icon
name={ICON_NAMES.COPY}
size={ICON_SIZES.LG}
color={Color.iconAlternative}
onClick={() => handleCopy(text)}
size={18}
/>
)}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getAccountLink } from '@metamask/etherscan-link';
import { useSelector } from 'react-redux';
import classnames from 'classnames';
import Box from '../../../ui/box';
import IconCopy from '../../../ui/icon/icon-copy';
import IconBlockExplorer from '../../../ui/icon/icon-block-explorer';
import Button from '../../../ui/button/button.component';
import Tooltip from '../../../ui/tooltip/tooltip';
Expand All @@ -22,12 +21,14 @@ import {
BorderStyle,
BorderColor,
TextColor,
Color,
} from '../../../../helpers/constants/design-system';
import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard';
import UrlIcon from '../../../ui/url-icon/url-icon';
import { getAddressBookEntry } from '../../../../selectors';
import { TokenStandard } from '../../../../../shared/constants/transaction';
import NftCollectionImage from '../../../ui/nft-collection-image/nft-collection-image';
import { ButtonIcon, ICON_NAMES } from '../../../component-library';

export default function ContractDetailsModal({
onClose,
Expand Down Expand Up @@ -146,15 +147,15 @@ export default function ContractDetailsModal({
: t('copyToClipboard')
}
>
<Button
className="contract-details-modal__content__contract__buttons__copy"
type="link"
onClick={() => {
handleCopyTokenAddress(tokenAddress);
}}
>
<IconCopy color="var(--color-icon-muted)" />
</Button>
<ButtonIcon
iconName={
copiedTokenAddress
? ICON_NAMES.COPY_SUCCESS
: ICON_NAMES.COPY
}
onClick={() => handleCopyTokenAddress(tokenAddress)}
color={Color.iconMuted}
/>
</Tooltip>
</Box>
<Box marginTop={5} marginRight={5}>
Expand Down Expand Up @@ -264,15 +265,13 @@ export default function ContractDetailsModal({
: t('copyToClipboard')
}
>
<Button
className="contract-details-modal__content__contract__buttons__copy"
type="link"
onClick={() => {
handleCopyToAddress(toAddress);
}}
>
<IconCopy color="var(--color-icon-muted)" />
</Button>
<ButtonIcon
iconName={
copiedToAddress ? ICON_NAMES.COPY_SUCCESS : ICON_NAMES.COPY
}
onClick={() => handleCopyToAddress(toAddress)}
color={Color.iconMuted}
/>
</Tooltip>
</Box>
<Box marginTop={5} marginRight={5}>
Expand Down
14 changes: 5 additions & 9 deletions ui/components/ui/contract-token-values/contract-token-values.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { getAccountLink } from '@metamask/etherscan-link';
import IconCopy from '../icon/icon-copy';
import IconBlockExplorer from '../icon/icon-block-explorer';
import Box from '../box/box';
import Tooltip from '../tooltip/tooltip';
Expand All @@ -18,6 +17,7 @@ import {
} from '../../../helpers/constants/design-system';
import Button from '../button';
import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard';
import { ButtonIcon, ICON_NAMES } from '../../component-library';

export default function ContractTokenValues({
address,
Expand Down Expand Up @@ -52,15 +52,11 @@ export default function ContractTokenValues({
position="top"
title={copied ? t('copiedExclamation') : t('copyToClipboard')}
>
<Button
type="link"
<ButtonIcon
iconName={copied ? ICON_NAMES.COPY_SUCCESS : ICON_NAMES.COPY}
className="contract-token-values__copy-address__button"
onClick={() => {
handleCopy(address);
}}
>
<IconCopy size={24} color="var(--color-icon-muted)" />
</Button>
onClick={() => handleCopy(address)}
/>
</Tooltip>
</Box>
<Box className="contract-token-values__block-explorer">
Expand Down
9 changes: 0 additions & 9 deletions ui/components/ui/icon/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SendIcon from './send-icon.component';
import Sign from './sign-icon.component';
import SunCheck from './sun-check-icon.component';
import Swap from './swap-icon-for-list.component';
import IconCopy from './icon-copy'
import IconBlockExplorer from './icon-block-explorer';


Expand Down Expand Up @@ -182,14 +181,6 @@ Use the `className` prop to add an additional class to the icon. This additional

<ArgsTable of={Preloader} />

## IconCopy

<Canvas>
<Story id="components-ui-icon--icon-copy-story" />
</Canvas>

<ArgsTable of={IconCopy} />

## IconBlockExplorer

<Canvas>
Expand Down
49 changes: 0 additions & 49 deletions ui/components/ui/icon/icon-copied.js

This file was deleted.

47 changes: 0 additions & 47 deletions ui/components/ui/icon/icon-copy.js

This file was deleted.

42 changes: 0 additions & 42 deletions ui/components/ui/icon/icon-speech-bubbles.js

This file was deleted.

12 changes: 0 additions & 12 deletions ui/components/ui/icon/icon.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ import IconCheck from './icon-check';
import IconCog from './icon-cog';
import IconConnect from './icon-connect';
import IconImport from './icon-import';
import IconSpeechBubbles from './icon-speech-bubbles';
import IconPlus from './icon-plus';
import IconEye from './icon-eye';
import IconEyeSlash from './icon-eye-slash';
import IconTokenSearch from './icon-token-search';
import SearchIcon from './search-icon';
import IconCopy from './icon-copy';
import IconBlockExplorer from './icon-block-explorer';
import IconCopied from './icon-copied';

const validColors = [
'var(--color-icon-default)',
Expand Down Expand Up @@ -128,13 +125,10 @@ export const DefaultStory = (args) => (
<IconItem Component={<IconPlus {...args} />} />
<IconItem Component={<IconImport {...args} />} />
<IconItem Component={<IconConnect {...args} />} />
<IconItem Component={<IconSpeechBubbles {...args} />} />
<IconItem Component={<IconCog {...args} />} />
<IconItem Component={<IconTokenSearch {...args} />} />
<IconItem Component={<SearchIcon {...args} />} />
<IconItem Component={<IconCopy {...args} />} />
<IconItem Component={<IconBlockExplorer {...args} />} />
<IconItem Component={<IconCopied {...args} />} />
</div>
</Box>
<Typography
Expand Down Expand Up @@ -289,12 +283,6 @@ PreloaderStory.args = {
};
PreloaderStory.storyName = 'Preloader';

export const IconCopyStory = (args) => <IconCopy {...args} />;
IconCopyStory.args = {
size: 40,
};
IconCopyStory.storyName = 'IconCopy';

export const IconBlockExplorerStory = (args) => <IconBlockExplorer {...args} />;
IconBlockExplorerStory.args = {
size: 40,
Expand Down

0 comments on commit 2c50a7b

Please sign in to comment.