1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix #17362 - Ensure NFT icons are correct (#17440)

* Fix #17362 - Ensure NFT icons are correct

* Update trash icon
This commit is contained in:
David Walsh 2023-01-27 08:32:03 -06:00 committed by GitHub
parent b21e0df4fa
commit 6ee2d07706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { I18nContext } from '../../../contexts/i18n';
import { Menu, MenuItem } from '../../ui/menu';
import { ICON_NAMES } from '../../component-library';
const CollectibleOptions = ({ onRemove, onViewOnOpensea }) => {
const t = useContext(I18nContext);
@ -25,7 +26,7 @@ const CollectibleOptions = ({ onRemove, onViewOnOpensea }) => {
>
{onViewOnOpensea ? (
<MenuItem
iconClassName="fas fa-qrcode"
iconName={ICON_NAMES.EXPORT}
data-testid="collectible-options__view-on-opensea"
onClick={() => {
setCollectibleOptionsOpen(false);
@ -36,7 +37,7 @@ const CollectibleOptions = ({ onRemove, onViewOnOpensea }) => {
</MenuItem>
) : null}
<MenuItem
iconClassName="fas fa-trash-alt collectible-options__icon"
iconName={ICON_NAMES.TRASH}
data-testid="collectible-options__hide"
onClick={() => {
setCollectibleOptionsOpen(false);

View File

@ -2,11 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { Icon, ICON_SIZES } from '../../component-library';
const MenuItem = ({
children,
className,
'data-testid': dataTestId,
iconClassName,
iconName,
onClick,
subtitle,
}) => (
@ -18,6 +21,9 @@ const MenuItem = ({
{iconClassName ? (
<i className={classnames('menu-item__icon', iconClassName)} />
) : null}
{iconName ? (
<Icon name={iconName} size={ICON_SIZES.SM} marginRight={2} />
) : null}
<span>{children}</span>
{subtitle}
</button>
@ -28,6 +34,7 @@ MenuItem.propTypes = {
className: PropTypes.string,
'data-testid': PropTypes.string,
iconClassName: PropTypes.string,
iconName: PropTypes.string,
onClick: PropTypes.func,
subtitle: PropTypes.node,
};
@ -36,6 +43,7 @@ MenuItem.defaultProps = {
className: undefined,
'data-testid': undefined,
iconClassName: undefined,
iconName: undefined,
onClick: undefined,
subtitle: undefined,
};