Commit e46676a1 authored by isstuev's avatar isstuev

fix

parent 02e7c271
......@@ -15,7 +15,7 @@ import NFTItemContainer from './NFTItemContainer';
type Props = AddressNFT & { isLoading: boolean; withTokenLink?: boolean };
const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: Props) => {
const valueResult = token.decimals ? getCurrencyValue({ value, decimals: token.decimals, accuracy: 2 }).valueStr : value;
const valueResult = token.decimals && value ? getCurrencyValue({ value, decimals: token.decimals, accuracy: 2 }).valueStr : value;
const tokenInstanceLink = tokenInstance.id ?
route({ pathname: '/token/[hash]/instance/[id]', query: { hash: token.address, id: tokenInstance.id } }) :
undefined;
......
......@@ -77,7 +77,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
let totalSupplyValue;
if (type === 'ERC-20') {
if (decimals) {
const totalValue = totalSupply ? getCurrencyValue({ value: totalSupply, accuracy: 3, accuracyUsd: 2, exchangeRate, decimals }) : undefined;
totalSupplyValue = totalValue?.valueStr;
} else {
......
......@@ -15,6 +15,29 @@ interface Props {
const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
const num = value === '1' ? '' : value;
const tokenIdContent = (() => {
if (tokenId === null) {
// ERC-404 may not have an ID
if (token.type === 'ERC-404') {
return null;
}
return <chakra.span color="text_secondary"> N/A </chakra.span>;
}
return (
<NftEntity
hash={ token.address }
id={ tokenId }
fontWeight={ 600 }
iconSize="md"
maxW={{ base: '100%', lg: '150px' }}
w="auto"
flexShrink={ 0 }
/>
);
})();
return (
<>
{ num ? (
......@@ -26,18 +49,7 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
) : (
<chakra.span color="text_secondary">for token ID</chakra.span>
) }
{ tokenId !== null ? (
<NftEntity
hash={ token.address }
id={ tokenId }
fontWeight={ 600 }
iconSize="md"
maxW={{ base: '100%', lg: '150px' }}
w="auto"
flexShrink={ 0 }
/>
) : <chakra.span color="text_secondary"> N/A </chakra.span>
}
{ tokenIdContent }
<chakra.span color="text_secondary">of</chakra.span>
<TokenEntity
token={ token }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment