Skip to content

Commit

Permalink
fix: total balance display (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao authored Jul 23, 2024
1 parent 7c52f9d commit 10345ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/hybrid-pay/src/hooks/useTotalBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const useTotalBalance = (chainId: ChainId) => {
? Object.values(erc20Balances).reduce((acc, amount) => {
return acc.add(calculateAmountUSD(amount, getPrice(amount.currency.symbol)));
}, new Big(0))
: new Big(0);
: undefined;
};

export { useTotalBalance };
13 changes: 3 additions & 10 deletions apps/hybrid-pay/src/pages/Wallet/components/Hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,11 @@ const Hero = ({}: HeroProps): JSX.Element => {
return (
<Flex direction='column' flex={1} gap='6xl' justifyContent='center' marginY='xl' paddingX='xl'>
<Flex alignItems='center' direction='column' flex={1} justifyContent='center'>
{/* {isPending ? (
<Skeleton
baseColor='rgba(255, 255, 255, 0.13)'
height='3.75rem'
highlightColor='rgba(255, 255, 255, 0.13)'
width={150}
/>
) : ( */}
<H1 size='5xl' weight='bold'>
{Intl.NumberFormat(locale, { style: 'currency', currency: 'USD' }).format(totalBalance?.toNumber() || 0)}
{totalBalance
? Intl.NumberFormat(locale, { style: 'currency', currency: 'USD' }).format(totalBalance?.toNumber())
: '-'}
</H1>
{/* )} */}
</Flex>
<Flex flex={1} gap='xl' justifyContent='center'>
<Button fullWidth aria-label='navigate to send page' size='xl' onPress={handleSend}>
Expand Down

0 comments on commit 10345ee

Please sign in to comment.