diff --git a/ui/addresses/AddressesTableItem.tsx b/ui/addresses/AddressesTableItem.tsx
index 5508b555d8..05f2f0ce0a 100644
--- a/ui/addresses/AddressesTableItem.tsx
+++ b/ui/addresses/AddressesTableItem.tsx
@@ -11,7 +11,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
type Props = {
item: AddressesItem;
index: number;
- totalSupply: string;
+ totalSupply: BigNumber;
hasPercentage: boolean;
isLoading?: boolean;
}
@@ -55,7 +55,7 @@ const AddressesTableItem = ({
{ hasPercentage && (
- { addressBalance.div(BigNumber(totalSupply)).multipliedBy(100).dp(8).toFormat() + '%' }
+ { addressBalance.div(totalSupply).multipliedBy(100).dp(8).toFormat() + '%' }
|
) }
diff --git a/ui/pages/Accounts.tsx b/ui/pages/Accounts.tsx
index 1eadcc0484..ce9a8009bc 100644
--- a/ui/pages/Accounts.tsx
+++ b/ui/pages/Accounts.tsx
@@ -1,4 +1,5 @@
import { Hide, Show } from '@chakra-ui/react';
+import BigNumber from 'bignumber.js';
import React from 'react';
import { TOP_ADDRESS } from 'stubs/address';
@@ -39,13 +40,17 @@ const Accounts = () => {
);
const pageStartIndex = (pagination.page - 1) * PAGE_SIZE + 1;
+ const totalSupply = React.useMemo(() => {
+ return BigNumber(data?.total_supply || '0');
+ }, [ data?.total_supply ]);
+
const content = data?.items ? (
<>
@@ -57,7 +62,7 @@ const Accounts = () => {
key={ item.hash + (isPlaceholderData ? index : '') }
item={ item }
index={ pageStartIndex + index }
- totalSupply={ data.total_supply }
+ totalSupply={ totalSupply }
isLoading={ isPlaceholderData }
/>
);
|