mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
33cc8d587a
* replaced all the instances of collectibles with nfts * updated actions * updated e2e seeder * updated confirm Approve test * updated test dapp change * updated test dapp change * nit fix * nit fix * updated casing and snapshots * updated casinG * added migrations * updated ,igration * updated 078.test * updated tests for 078 migration * updated migration * updated 078 index.js
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classnames from 'classnames';
|
|
import Typography from '../../ui/typography';
|
|
import { TypographyVariant } from '../../../helpers/constants/design-system';
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
export default function NftDefaultImage({ name, tokenId, handleImageClick }) {
|
|
const t = useI18nContext();
|
|
const Tag = handleImageClick ? 'button' : 'div';
|
|
return (
|
|
<Tag
|
|
tabIndex={0}
|
|
data-testid="nft-default-image"
|
|
className={classnames('nft-default', {
|
|
'nft-default--clickable': handleImageClick,
|
|
})}
|
|
onClick={handleImageClick}
|
|
>
|
|
<Typography variant={TypographyVariant.H6} className="nft-default__text">
|
|
{name ?? t('unknownCollection')} <br /> #{tokenId}
|
|
</Typography>
|
|
</Tag>
|
|
);
|
|
}
|
|
|
|
NftDefaultImage.propTypes = {
|
|
/**
|
|
* The name of the NFT collection if not supplied will default to "Unnamed collection"
|
|
*/
|
|
name: PropTypes.string,
|
|
/**
|
|
* The token id of the nft
|
|
*/
|
|
tokenId: PropTypes.string,
|
|
/**
|
|
* The click handler for the NFT default image
|
|
*/
|
|
handleImageClick: PropTypes.func,
|
|
};
|