Skip to content

Commit

Permalink
Always load totalBalance so hide and show works right (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngkidwarrior authored Oct 24, 2024
2 parents 0cd5b19 + ce09350 commit 1649e24
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/app/features/home/TokenBalanceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const TokenBalanceCard = () => {
return (
<XStack w={'100%'} zIndex={4}>
<YStack jc={'center'} gap={'$4'} w={'100%'}>
<XStack ai={'center'} gap="$2.5" width={'100%'}>
<XStack ai={'center'} gap="$2.5" width={'100%'} onPress={toggleIsPriceHidden}>
<XStack ai={'center'} gap="$2.5">
<AnimatePresence exitBeforeEnter>
{isPriceHidden ? <HiddenSquare /> : <GreenSquare />}
Expand All @@ -58,24 +58,17 @@ export const TokenBalanceCard = () => {
Total Balance
</Label>
</XStack>
<Button
onPress={toggleIsPriceHidden}
p={'$2'}
size={'$3'}
circular={true}
chromeless
iconAfter={
isPriceHidden ? (
<EyeOff color={'$color9'} size={'$2'} />
) : (
<Eye color={'$color11'} size={'$2'} />
)
}
/>
{isPriceHidden ? (
<EyeOff color={'$color9'} size={'$1'} />
) : (
<Eye color={'$color11'} size={'$1'} />
)}
</XStack>
<XStack style={{ color: 'white' }} gap={'$2.5'} mt={'$3'}>
{(() => {
switch (true) {
case isLoading:
return <Spinner size={'large'} />
case isPriceHidden:
return (
<BigHeading
Expand All @@ -89,8 +82,6 @@ export const TokenBalanceCard = () => {
{'//////'}
</BigHeading>
)
case isLoading:
return <Spinner size={'large'} />
default:
return (
<>
Expand Down

0 comments on commit 1649e24

Please sign in to comment.