Commit cba7470a authored by isstuev's avatar isstuev

fixes

parent ad766958
...@@ -4,6 +4,7 @@ import React from 'react'; ...@@ -4,6 +4,7 @@ import React from 'react';
import { route } from 'nextjs-routes'; import { route } from 'nextjs-routes';
import getCurrencyValue from 'lib/getCurrencyValue';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import LinkInternal from 'ui/shared/LinkInternal'; import LinkInternal from 'ui/shared/LinkInternal';
import TruncatedValue from 'ui/shared/TruncatedValue'; import TruncatedValue from 'ui/shared/TruncatedValue';
...@@ -55,7 +56,10 @@ const TokenSelectItem = ({ data }: Props) => { ...@@ -55,7 +56,10 @@ const TokenSelectItem = ({ data }: Props) => {
) } ) }
{ data.value !== null && ( { data.value !== null && (
<span> <span>
{ BigNumber(data.value).toFormat() } { data.token.decimals ?
getCurrencyValue({ value: data.value, decimals: data.token.decimals, accuracy: 2 }).valueStr :
BigNumber(data.value).toFormat()
}
</span> </span>
) } ) }
</> </>
......
...@@ -5,6 +5,7 @@ import type { AddressNFT } from 'types/api/address'; ...@@ -5,6 +5,7 @@ import type { AddressNFT } from 'types/api/address';
import { route } from 'nextjs-routes'; import { route } from 'nextjs-routes';
import getCurrencyValue from 'lib/getCurrencyValue';
import NftEntity from 'ui/shared/entities/nft/NftEntity'; import NftEntity from 'ui/shared/entities/nft/NftEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import NftMedia from 'ui/shared/nft/NftMedia'; import NftMedia from 'ui/shared/nft/NftMedia';
...@@ -14,6 +15,7 @@ import NFTItemContainer from './NFTItemContainer'; ...@@ -14,6 +15,7 @@ import NFTItemContainer from './NFTItemContainer';
type Props = AddressNFT & { isLoading: boolean; withTokenLink?: boolean }; type Props = AddressNFT & { isLoading: boolean; withTokenLink?: boolean };
const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: Props) => { const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: Props) => {
const valueResult = token.decimals ? getCurrencyValue({ value, decimals: token.decimals, accuracy: 2 }).valueStr : value;
const tokenInstanceLink = tokenInstance.id ? const tokenInstanceLink = tokenInstance.id ?
route({ pathname: '/token/[hash]/instance/[id]', query: { hash: token.address, id: tokenInstance.id } }) : route({ pathname: '/token/[hash]/instance/[id]', query: { hash: token.address, id: tokenInstance.id } }) :
undefined; undefined;
...@@ -31,13 +33,18 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P ...@@ -31,13 +33,18 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
isLoading={ isLoading } isLoading={ isLoading }
/> />
</Link> </Link>
<Flex justifyContent="space-between" w="100%"> <Flex justifyContent="space-between" w="100%" flexWrap="wrap">
<Flex ml={ 1 } overflow="hidden"> <Flex ml={ 1 } overflow="hidden">
<Text whiteSpace="pre" variant="secondary">ID# </Text> <Text whiteSpace="pre" variant="secondary">ID# </Text>
<NftEntity hash={ token.address } id={ tokenInstance.id } isLoading={ isLoading } noIcon/> <NftEntity hash={ token.address } id={ tokenInstance.id } isLoading={ isLoading } noIcon/>
</Flex> </Flex>
<Skeleton isLoaded={ !isLoading }> <Skeleton isLoaded={ !isLoading } overflow="hidden" ml={ 1 }>
{ Number(value) > 1 && <Flex><Text variant="secondary" whiteSpace="pre">Qty </Text>{ value }</Flex> } { valueResult && (
<Flex>
<Text variant="secondary" whiteSpace="pre">Qty </Text>
<Text overflow="hidden" wordBreak="break-all">{ valueResult }</Text>
</Flex>
) }
</Skeleton> </Skeleton>
</Flex> </Flex>
{ withTokenLink && ( { withTokenLink && (
......
...@@ -47,7 +47,7 @@ const TokenHoldersListItem = ({ holder, token, isLoading }: Props) => { ...@@ -47,7 +47,7 @@ const TokenHoldersListItem = ({ holder, token, isLoading }: Props) => {
</Skeleton> </Skeleton>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
{ token.total_supply && ( { token.total_supply && token.type !== 'ERC-404' && (
<> <>
<ListItemMobileGrid.Label isLoading={ isLoading }>Percentage</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Percentage</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
......
...@@ -21,7 +21,7 @@ const TokenHoldersTable = ({ data, token, top, isLoading }: Props) => { ...@@ -21,7 +21,7 @@ const TokenHoldersTable = ({ data, token, top, isLoading }: Props) => {
<Th>Holder</Th> <Th>Holder</Th>
{ (token.type === 'ERC-1155' || token.type === 'ERC-404') && <Th>ID#</Th> } { (token.type === 'ERC-1155' || token.type === 'ERC-404') && <Th>ID#</Th> }
<Th isNumeric>Quantity</Th> <Th isNumeric>Quantity</Th>
{ token.total_supply && <Th isNumeric width="175px">Percentage</Th> } { token.total_supply && token.type !== 'ERC-404' && <Th isNumeric width="175px">Percentage</Th> }
</Tr> </Tr>
</Thead> </Thead>
<Tbody> <Tbody>
......
...@@ -38,7 +38,7 @@ const TokenTransferTableItem = ({ holder, token, isLoading }: Props) => { ...@@ -38,7 +38,7 @@ const TokenTransferTableItem = ({ holder, token, isLoading }: Props) => {
{ quantity } { quantity }
</Skeleton> </Skeleton>
</Td> </Td>
{ token.total_supply && ( { token.total_supply && token.type !== 'ERC-404' && (
<Td verticalAlign="middle" isNumeric> <Td verticalAlign="middle" isNumeric>
<Utilization <Utilization
value={ BigNumber(holder.value).div(BigNumber(token.total_supply)).dp(4).toNumber() } value={ BigNumber(holder.value).div(BigNumber(token.total_supply)).dp(4).toNumber() }
......
...@@ -32,9 +32,9 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket ...@@ -32,9 +32,9 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
<Tr> <Tr>
<Th width="280px">Txn hash</Th> <Th width="280px">Txn hash</Th>
<Th width="200px">Method</Th> <Th width="200px">Method</Th>
<Th width={{ lg: '224px', xl: '420px' }}>From/To</Th> <Th width={{ lg: '224px', xl: '380px' }}>From/To</Th>
{ (NFT_TOKEN_TYPE_IDS.includes(tokenType)) && { (NFT_TOKEN_TYPE_IDS.includes(tokenType)) &&
<Th width={ tokenType === 'ERC-1155' ? '50%' : '100%' }>Token ID</Th> <Th width={ tokenType === 'ERC-1155' || tokenType === 'ERC-404' ? '50%' : '100%' }>Token ID</Th>
} }
{ (tokenType === 'ERC-20' || tokenType === 'ERC-1155' || tokenType === 'ERC-404') && ( { (tokenType === 'ERC-20' || tokenType === 'ERC-1155' || tokenType === 'ERC-404') && (
<Th width={ tokenType === 'ERC-20' ? '100%' : '50%' } isNumeric> <Th width={ tokenType === 'ERC-20' ? '100%' : '50%' } isNumeric>
......
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