2022-01-10 17:23:53 +01:00
|
|
|
import React, { useEffect } from 'react';
|
2021-12-14 00:41:10 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
import { useHistory } from 'react-router-dom';
|
2022-01-10 17:23:53 +01:00
|
|
|
import { isEqual } from 'lodash';
|
2021-12-14 00:41:10 +01:00
|
|
|
import Box from '../../ui/box';
|
|
|
|
import Card from '../../ui/card';
|
|
|
|
import Typography from '../../ui/typography/typography';
|
|
|
|
import {
|
2023-02-02 21:15:26 +01:00
|
|
|
TextColor,
|
|
|
|
IconColor,
|
|
|
|
TypographyVariant,
|
2021-12-14 00:41:10 +01:00
|
|
|
FONT_WEIGHT,
|
2023-02-02 21:15:26 +01:00
|
|
|
JustifyContent,
|
2021-12-14 00:41:10 +01:00
|
|
|
FLEX_DIRECTION,
|
|
|
|
OVERFLOW_WRAP,
|
|
|
|
DISPLAY,
|
2022-01-10 17:23:53 +01:00
|
|
|
BLOCK_SIZES,
|
2021-12-14 00:41:10 +01:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
2023-02-02 19:26:36 +01:00
|
|
|
import {
|
|
|
|
formatDate,
|
|
|
|
getAssetImageURL,
|
|
|
|
shortenAddress,
|
|
|
|
} from '../../../helpers/utils/util';
|
2023-02-08 15:34:56 +01:00
|
|
|
import { getCollectibleImageAlt } from '../../../helpers/utils/nfts';
|
2021-12-14 00:41:10 +01:00
|
|
|
import {
|
|
|
|
getCurrentChainId,
|
|
|
|
getIpfsGateway,
|
|
|
|
getSelectedIdentity,
|
|
|
|
} from '../../../selectors';
|
|
|
|
import AssetNavigation from '../../../pages/asset/components/asset-navigation';
|
|
|
|
import { getCollectibleContracts } from '../../../ducks/metamask/metamask';
|
2022-01-10 17:23:53 +01:00
|
|
|
import { DEFAULT_ROUTE, SEND_ROUTE } from '../../../helpers/constants/routes';
|
|
|
|
import {
|
2022-11-15 19:49:42 +01:00
|
|
|
checkAndUpdateSingleNftOwnershipStatus,
|
|
|
|
removeAndIgnoreNft,
|
2023-01-23 12:53:44 +01:00
|
|
|
setRemoveCollectibleMessage,
|
2022-01-10 17:23:53 +01:00
|
|
|
} from '../../../store/actions';
|
2022-09-14 16:55:31 +02:00
|
|
|
import { CHAIN_IDS } from '../../../../shared/constants/network';
|
2021-12-14 00:41:10 +01:00
|
|
|
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
|
|
|
|
import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app';
|
2023-02-08 15:34:56 +01:00
|
|
|
import CollectibleOptions from '../nft-options/nft-options';
|
2022-01-10 17:23:53 +01:00
|
|
|
import Button from '../../ui/button';
|
2022-07-01 15:58:35 +02:00
|
|
|
import { startNewDraftTransaction } from '../../../ducks/send';
|
2022-01-10 17:23:53 +01:00
|
|
|
import InfoTooltip from '../../ui/info-tooltip';
|
|
|
|
import { usePrevious } from '../../../hooks/usePrevious';
|
2022-01-27 18:26:33 +01:00
|
|
|
import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard';
|
2022-03-07 19:54:36 +01:00
|
|
|
import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils';
|
2023-01-18 15:47:29 +01:00
|
|
|
import {
|
|
|
|
AssetType,
|
|
|
|
TokenStandard,
|
|
|
|
} from '../../../../shared/constants/transaction';
|
2023-02-08 15:34:56 +01:00
|
|
|
import CollectibleDefaultImage from '../nft-default-image';
|
2023-02-02 19:26:36 +01:00
|
|
|
import { ButtonIcon, ICON_NAMES } from '../../component-library';
|
|
|
|
import Tooltip from '../../ui/tooltip';
|
2021-12-14 00:41:10 +01:00
|
|
|
|
|
|
|
export default function CollectibleDetails({ collectible }) {
|
2022-01-10 17:23:53 +01:00
|
|
|
const {
|
|
|
|
image,
|
2022-01-27 18:26:33 +01:00
|
|
|
imageOriginal,
|
2022-01-10 17:23:53 +01:00
|
|
|
name,
|
|
|
|
description,
|
|
|
|
address,
|
|
|
|
tokenId,
|
|
|
|
standard,
|
|
|
|
isCurrentlyOwned,
|
2023-02-02 19:26:36 +01:00
|
|
|
lastSale,
|
|
|
|
imageThumbnail,
|
2022-01-10 17:23:53 +01:00
|
|
|
} = collectible;
|
2021-12-14 00:41:10 +01:00
|
|
|
const t = useI18nContext();
|
|
|
|
const history = useHistory();
|
2022-01-10 17:23:53 +01:00
|
|
|
const dispatch = useDispatch();
|
2021-12-14 00:41:10 +01:00
|
|
|
const ipfsGateway = useSelector(getIpfsGateway);
|
|
|
|
const collectibleContracts = useSelector(getCollectibleContracts);
|
|
|
|
const currentNetwork = useSelector(getCurrentChainId);
|
2023-01-18 23:39:15 +01:00
|
|
|
const [addressCopied, handleAddressCopy] = useCopyToClipboard();
|
2021-12-14 00:41:10 +01:00
|
|
|
|
|
|
|
const collectibleContractName = collectibleContracts.find(
|
|
|
|
({ address: contractAddress }) =>
|
|
|
|
isEqualCaseInsensitive(contractAddress, address),
|
|
|
|
)?.name;
|
|
|
|
const selectedAccountName = useSelector(
|
|
|
|
(state) => getSelectedIdentity(state).name,
|
|
|
|
);
|
2023-02-02 19:26:36 +01:00
|
|
|
const collectibleImageAlt = getCollectibleImageAlt(collectible);
|
2022-01-27 18:26:33 +01:00
|
|
|
const collectibleImageURL = getAssetImageURL(
|
|
|
|
imageOriginal ?? image,
|
|
|
|
ipfsGateway,
|
|
|
|
);
|
2023-01-18 23:39:15 +01:00
|
|
|
const isDataURI = collectibleImageURL.startsWith('data:');
|
2023-02-02 19:26:36 +01:00
|
|
|
const formattedTimestamp = formatDate(
|
|
|
|
new Date(lastSale?.event_timestamp).getTime(),
|
|
|
|
'M/d/y',
|
|
|
|
);
|
2021-12-14 00:41:10 +01:00
|
|
|
|
|
|
|
const onRemove = () => {
|
2022-11-15 19:49:42 +01:00
|
|
|
dispatch(removeAndIgnoreNft(address, tokenId));
|
2023-01-23 12:53:44 +01:00
|
|
|
dispatch(setRemoveCollectibleMessage('success'));
|
2021-12-14 00:41:10 +01:00
|
|
|
history.push(DEFAULT_ROUTE);
|
|
|
|
};
|
|
|
|
|
2022-01-10 17:23:53 +01:00
|
|
|
const prevCollectible = usePrevious(collectible);
|
|
|
|
useEffect(() => {
|
|
|
|
if (!isEqual(prevCollectible, collectible)) {
|
2022-11-15 19:49:42 +01:00
|
|
|
checkAndUpdateSingleNftOwnershipStatus(collectible);
|
2022-01-10 17:23:53 +01:00
|
|
|
}
|
|
|
|
}, [collectible, prevCollectible]);
|
|
|
|
|
2021-12-14 00:41:10 +01:00
|
|
|
const getOpenSeaLink = () => {
|
|
|
|
switch (currentNetwork) {
|
2022-09-14 16:55:31 +02:00
|
|
|
case CHAIN_IDS.MAINNET:
|
2021-12-14 00:41:10 +01:00
|
|
|
return `https://opensea.io/assets/${address}/${tokenId}`;
|
2022-09-14 16:55:31 +02:00
|
|
|
case CHAIN_IDS.POLYGON:
|
2021-12-14 00:41:10 +01:00
|
|
|
return `https://opensea.io/assets/matic/${address}/${tokenId}`;
|
2022-09-14 16:55:31 +02:00
|
|
|
case CHAIN_IDS.GOERLI:
|
2022-09-14 20:26:45 +02:00
|
|
|
case CHAIN_IDS.SEPOLIA:
|
2021-12-14 00:41:10 +01:00
|
|
|
return `https://testnets.opensea.io/assets/${address}/${tokenId}`;
|
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const openSeaLink = getOpenSeaLink();
|
2023-01-18 15:47:29 +01:00
|
|
|
const sendDisabled = standard !== TokenStandard.ERC721;
|
2022-01-10 17:23:53 +01:00
|
|
|
const inPopUp = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP;
|
|
|
|
|
|
|
|
const onSend = async () => {
|
|
|
|
await dispatch(
|
2022-07-01 15:58:35 +02:00
|
|
|
startNewDraftTransaction({
|
2023-01-18 15:47:29 +01:00
|
|
|
type: AssetType.NFT,
|
2022-01-10 17:23:53 +01:00
|
|
|
details: collectible,
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
history.push(SEND_ROUTE);
|
|
|
|
};
|
|
|
|
|
|
|
|
const renderSendButton = () => {
|
|
|
|
if (isCurrentlyOwned === false) {
|
|
|
|
return <div style={{ height: '30px' }} />;
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
width={inPopUp ? BLOCK_SIZES.FULL : BLOCK_SIZES.HALF}
|
2022-01-20 18:49:49 +01:00
|
|
|
margin={inPopUp ? [4, 0] : null}
|
2022-01-10 17:23:53 +01:00
|
|
|
>
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
onClick={onSend}
|
|
|
|
disabled={sendDisabled}
|
|
|
|
className="collectible-details__send-button"
|
2023-02-07 19:06:37 +01:00
|
|
|
data-testid="collectible-send-button"
|
2022-01-10 17:23:53 +01:00
|
|
|
>
|
|
|
|
{t('send')}
|
|
|
|
</Button>
|
|
|
|
{sendDisabled ? (
|
|
|
|
<InfoTooltip position="top" contentText={t('sendingDisabled')} />
|
|
|
|
) : null}
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-12-14 00:41:10 +01:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<AssetNavigation
|
|
|
|
accountName={selectedAccountName}
|
|
|
|
assetName={collectibleContractName}
|
|
|
|
onBack={() => history.push(DEFAULT_ROUTE)}
|
|
|
|
optionsButton={
|
|
|
|
<CollectibleOptions
|
|
|
|
onViewOnOpensea={
|
|
|
|
openSeaLink
|
|
|
|
? () => global.platform.openTab({ url: openSeaLink })
|
|
|
|
: null
|
|
|
|
}
|
|
|
|
onRemove={onRemove}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
<Box className="collectible-details">
|
|
|
|
<div className="collectible-details__top-section">
|
|
|
|
<Card
|
|
|
|
padding={0}
|
2023-02-02 21:15:26 +01:00
|
|
|
justifyContent={JustifyContent.center}
|
2021-12-14 00:41:10 +01:00
|
|
|
className="collectible-details__card"
|
|
|
|
>
|
2022-06-30 17:46:38 +02:00
|
|
|
{image ? (
|
2023-01-23 23:04:11 +01:00
|
|
|
<img
|
|
|
|
className="collectible-details__image"
|
|
|
|
src={collectibleImageURL}
|
2023-01-25 15:08:35 +01:00
|
|
|
alt={collectibleImageAlt}
|
2023-01-23 23:04:11 +01:00
|
|
|
/>
|
2022-06-30 17:46:38 +02:00
|
|
|
) : (
|
|
|
|
<CollectibleDefaultImage name={name} tokenId={tokenId} />
|
|
|
|
)}
|
2021-12-14 00:41:10 +01:00
|
|
|
</Card>
|
|
|
|
<Box
|
|
|
|
flexDirection={FLEX_DIRECTION.COLUMN}
|
2022-01-10 17:23:53 +01:00
|
|
|
className="collectible-details__info"
|
2023-02-02 21:15:26 +01:00
|
|
|
justifyContent={JustifyContent.spaceBetween}
|
2021-12-14 00:41:10 +01:00
|
|
|
>
|
2022-01-10 17:23:53 +01:00
|
|
|
<div>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H4}
|
2022-01-10 17:23:53 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
2022-01-20 18:49:49 +01:00
|
|
|
boxProps={{ margin: 0, marginBottom: 2 }}
|
2022-01-10 17:23:53 +01:00
|
|
|
>
|
|
|
|
{name}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textMuted}
|
|
|
|
variant={TypographyVariant.H5}
|
2022-01-20 18:49:49 +01:00
|
|
|
boxProps={{ margin: 0, marginBottom: 4 }}
|
2022-01-10 17:23:53 +01:00
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
|
|
|
>
|
|
|
|
#{tokenId}
|
|
|
|
</Typography>
|
|
|
|
</div>
|
2022-01-20 18:49:49 +01:00
|
|
|
{description ? (
|
|
|
|
<div>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2022-01-20 18:49:49 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
className="collectible-details__description"
|
|
|
|
boxProps={{ margin: 0, marginBottom: 2 }}
|
|
|
|
>
|
|
|
|
{t('description')}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textAlternative}
|
|
|
|
variant={TypographyVariant.H6}
|
2022-06-30 17:46:38 +02:00
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
2022-01-20 18:49:49 +01:00
|
|
|
boxProps={{ margin: 0, marginBottom: 4 }}
|
|
|
|
>
|
|
|
|
{description}
|
|
|
|
</Typography>
|
|
|
|
</div>
|
|
|
|
) : null}
|
2022-01-10 17:23:53 +01:00
|
|
|
{inPopUp ? null : renderSendButton()}
|
2021-12-14 00:41:10 +01:00
|
|
|
</Box>
|
|
|
|
</div>
|
2022-01-10 17:23:53 +01:00
|
|
|
<Box marginBottom={2}>
|
2023-02-02 19:26:36 +01:00
|
|
|
{lastSale ? (
|
|
|
|
<>
|
|
|
|
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW}>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
marginRight: 2,
|
|
|
|
}}
|
|
|
|
className="collectible-details__link-title"
|
|
|
|
>
|
|
|
|
{t('lastSold')}
|
|
|
|
</Typography>
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
flexDirection={FLEX_DIRECTION.ROW}
|
|
|
|
className="collectible-details__contract-wrapper"
|
|
|
|
>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textAlternative}
|
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
|
|
|
boxProps={{ margin: 0, marginBottom: 4 }}
|
|
|
|
>
|
|
|
|
{formattedTimestamp}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW}>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
marginRight: 2,
|
|
|
|
}}
|
|
|
|
className="collectible-details__link-title"
|
|
|
|
>
|
|
|
|
{t('lastPriceSold')}
|
|
|
|
</Typography>
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
flexDirection={FLEX_DIRECTION.ROW}
|
|
|
|
className="collectible-details__contract-wrapper"
|
|
|
|
>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textAlternative}
|
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
|
|
|
boxProps={{ margin: 0, marginBottom: 4 }}
|
|
|
|
>
|
|
|
|
{lastSale.total_price}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
</>
|
|
|
|
) : null}
|
2021-12-14 00:41:10 +01:00
|
|
|
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW}>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2021-12-14 00:41:10 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
marginRight: 2,
|
|
|
|
}}
|
|
|
|
className="collectible-details__link-title"
|
|
|
|
>
|
|
|
|
{t('source')}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
variant={TypographyVariant.H6}
|
2021-12-14 00:41:10 +01:00
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
}}
|
2023-01-18 23:39:15 +01:00
|
|
|
className="collectible-details__image-source"
|
2023-02-02 21:15:26 +01:00
|
|
|
color={
|
|
|
|
isDataURI ? TextColor.textDefault : TextColor.primaryDefault
|
|
|
|
}
|
2021-12-14 00:41:10 +01:00
|
|
|
>
|
2023-01-18 23:39:15 +01:00
|
|
|
{isDataURI ? (
|
|
|
|
<>{collectibleImageURL}</>
|
|
|
|
) : (
|
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
href={collectibleImageURL}
|
|
|
|
title={collectibleImageURL}
|
|
|
|
>
|
|
|
|
{collectibleImageURL}
|
|
|
|
</a>
|
|
|
|
)}
|
2021-12-14 00:41:10 +01:00
|
|
|
</Typography>
|
2023-02-02 19:26:36 +01:00
|
|
|
</Box>
|
|
|
|
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW}>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
marginRight: 2,
|
2023-01-18 23:39:15 +01:00
|
|
|
}}
|
2023-02-02 19:26:36 +01:00
|
|
|
className="collectible-details__link-title"
|
|
|
|
>
|
|
|
|
{t('link')}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
variant={TypographyVariant.H6}
|
2023-02-02 19:26:36 +01:00
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
}}
|
|
|
|
className="collectible-details__image-source"
|
2023-02-02 21:15:26 +01:00
|
|
|
color={
|
|
|
|
isDataURI ? TextColor.textDefault : TextColor.primaryDefault
|
|
|
|
}
|
2023-02-02 19:26:36 +01:00
|
|
|
>
|
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
href={collectibleImageURL}
|
|
|
|
title={collectibleImageURL}
|
|
|
|
>
|
|
|
|
{imageThumbnail}
|
|
|
|
</a>
|
|
|
|
</Typography>
|
2021-12-14 00:41:10 +01:00
|
|
|
</Box>
|
|
|
|
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW}>
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textDefault}
|
|
|
|
variant={TypographyVariant.H6}
|
2021-12-14 00:41:10 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{
|
|
|
|
margin: 0,
|
|
|
|
marginBottom: 4,
|
|
|
|
marginRight: 2,
|
|
|
|
}}
|
|
|
|
className="collectible-details__link-title"
|
|
|
|
>
|
|
|
|
{t('contractAddress')}
|
|
|
|
</Typography>
|
2022-01-27 18:26:33 +01:00
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
flexDirection={FLEX_DIRECTION.ROW}
|
|
|
|
className="collectible-details__contract-wrapper"
|
2021-12-14 00:41:10 +01:00
|
|
|
>
|
2022-01-27 18:26:33 +01:00
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
color={TextColor.textAlternative}
|
|
|
|
variant={TypographyVariant.H6}
|
2022-01-27 18:26:33 +01:00
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
2023-02-02 19:26:36 +01:00
|
|
|
boxProps={{ margin: 0, marginBottom: 4 }}
|
2021-12-14 00:41:10 +01:00
|
|
|
>
|
2023-02-02 19:26:36 +01:00
|
|
|
{shortenAddress(address)}
|
2022-01-27 18:26:33 +01:00
|
|
|
</Typography>
|
2023-02-02 19:26:36 +01:00
|
|
|
<Tooltip
|
|
|
|
wrapperClassName="collectible-details__tooltip-wrapper"
|
|
|
|
position="bottom"
|
|
|
|
title={
|
|
|
|
addressCopied ? t('copiedExclamation') : t('copyToClipboard')
|
2023-01-18 23:39:15 +01:00
|
|
|
}
|
2023-02-02 19:26:36 +01:00
|
|
|
>
|
|
|
|
<ButtonIcon
|
|
|
|
ariaLabel="copy"
|
2023-02-02 21:15:26 +01:00
|
|
|
color={IconColor.iconAlternative}
|
2023-02-02 19:26:36 +01:00
|
|
|
className="collectible-details__contract-copy-button"
|
2023-02-07 19:06:37 +01:00
|
|
|
data-testid="collectible-address-copy"
|
2023-02-02 19:26:36 +01:00
|
|
|
onClick={() => {
|
|
|
|
handleAddressCopy(address);
|
|
|
|
}}
|
|
|
|
iconName={
|
|
|
|
addressCopied ? ICON_NAMES.COPY_SUCCESS : ICON_NAMES.COPY
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</Tooltip>
|
2022-01-27 18:26:33 +01:00
|
|
|
</Box>
|
2021-12-14 00:41:10 +01:00
|
|
|
</Box>
|
2022-01-10 17:23:53 +01:00
|
|
|
{inPopUp ? renderSendButton() : null}
|
2023-02-02 21:15:26 +01:00
|
|
|
<Typography
|
|
|
|
color={TextColor.textAlternative}
|
|
|
|
variant={TypographyVariant.H7}
|
|
|
|
>
|
2023-01-18 15:37:16 +01:00
|
|
|
{t('nftDisclaimer')}
|
|
|
|
</Typography>
|
2021-12-14 00:41:10 +01:00
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
CollectibleDetails.propTypes = {
|
|
|
|
collectible: PropTypes.shape({
|
|
|
|
address: PropTypes.string.isRequired,
|
|
|
|
tokenId: PropTypes.string.isRequired,
|
2022-01-10 17:23:53 +01:00
|
|
|
isCurrentlyOwned: PropTypes.bool,
|
2021-12-14 00:41:10 +01:00
|
|
|
name: PropTypes.string,
|
|
|
|
description: PropTypes.string,
|
|
|
|
image: PropTypes.string,
|
|
|
|
standard: PropTypes.string,
|
|
|
|
imageThumbnail: PropTypes.string,
|
|
|
|
imagePreview: PropTypes.string,
|
2022-01-27 18:26:33 +01:00
|
|
|
imageOriginal: PropTypes.string,
|
2021-12-14 00:41:10 +01:00
|
|
|
creator: PropTypes.shape({
|
|
|
|
address: PropTypes.string,
|
|
|
|
config: PropTypes.string,
|
|
|
|
profile_img_url: PropTypes.string,
|
|
|
|
}),
|
2023-02-02 19:26:36 +01:00
|
|
|
lastSale: PropTypes.shape({
|
|
|
|
event_timestamp: PropTypes.string,
|
|
|
|
total_price: PropTypes.string,
|
|
|
|
}),
|
2021-12-14 00:41:10 +01:00
|
|
|
}),
|
|
|
|
};
|