Commit e9aee06f authored by isstuev's avatar isstuev

fix token holders

parent 25f1beca
import { Flex, Skeleton } from '@chakra-ui/react'; import { Box, Flex, Skeleton } from '@chakra-ui/react';
import BigNumber from 'bignumber.js'; import BigNumber from 'bignumber.js';
import React from 'react'; import React from 'react';
...@@ -36,17 +36,20 @@ const TokenHoldersListItem = ({ holder, token, isLoading }: Props) => { ...@@ -36,17 +36,20 @@ const TokenHoldersListItem = ({ holder, token, isLoading }: Props) => {
<CopyToClipboard text={ holder.address.hash } isLoading={ isLoading }/> <CopyToClipboard text={ holder.address.hash } isLoading={ isLoading }/>
</Address> </Address>
<Flex justifyContent="space-between" alignItems="center" width="100%"> <Flex justifyContent="space-between" alignItems="center" width="100%">
<Skeleton isLoaded={ !isLoading } display="inline-block"> <Skeleton isLoaded={ !isLoading } display="inline-block" width="100%">
{ quantity } <Box as="span" wordBreak="break-word" mr={ 6 }>
{ quantity }
</Box>
{ token.total_supply && (
<Utilization
value={ BigNumber(holder.value).div(BigNumber(token.total_supply)).dp(4).toNumber() }
colorScheme="green"
isLoading={ isLoading }
display="inline-flex"
float="right"
/>
) }
</Skeleton> </Skeleton>
{ token.total_supply && (
<Utilization
value={ BigNumber(holder.value).div(BigNumber(token.total_supply)).dp(4).toNumber() }
colorScheme="green"
ml={ 6 }
isLoading={ isLoading }
/>
) }
</Flex> </Flex>
</ListItemMobile> </ListItemMobile>
); );
......
...@@ -15,11 +15,11 @@ interface Props { ...@@ -15,11 +15,11 @@ interface Props {
const TokenHoldersTable = ({ data, token, top, isLoading }: Props) => { const TokenHoldersTable = ({ data, token, top, isLoading }: Props) => {
return ( return (
<Table variant="simple" size="sm"> <Table variant="simple" size="sm" style={{ tableLayout: 'auto' }}>
<Thead top={ top }> <Thead top={ top }>
<Tr> <Tr>
<Th>Holder</Th> <Th>Holder</Th>
<Th isNumeric width="300px">Quantity</Th> <Th isNumeric>Quantity</Th>
{ token.total_supply && <Th isNumeric width="175px">Percentage</Th> } { token.total_supply && <Th isNumeric width="175px">Percentage</Th> }
</Tr> </Tr>
</Thead> </Thead>
......
...@@ -32,12 +32,13 @@ const TokenTransferTableItem = ({ holder, token, isLoading }: Props) => { ...@@ -32,12 +32,13 @@ const TokenTransferTableItem = ({ holder, token, isLoading }: Props) => {
alias={ holder.address.name } alias={ holder.address.name }
flexGrow={ 1 } flexGrow={ 1 }
isLoading={ isLoading } isLoading={ isLoading }
truncation="constant"
/> />
<CopyToClipboard text={ holder.address.hash } isLoading={ isLoading }/> <CopyToClipboard text={ holder.address.hash } isLoading={ isLoading }/>
</Address> </Address>
</Td> </Td>
<Td verticalAlign="middle" isNumeric> <Td verticalAlign="middle" isNumeric>
<Skeleton isLoaded={ !isLoading } display="inline-block"> <Skeleton isLoaded={ !isLoading } display="inline-block" wordBreak="break-word">
{ quantity } { quantity }
</Skeleton> </Skeleton>
</Td> </Td>
......
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