Skip to content

Commit 1035fe1

Browse files
authored
Use isPending instead of isLoading for balance loading state (#11978)
1 parent f24bb7f commit 1035fe1

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

packages/common/src/api/tan-query/wallets/useUSDCBalance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const useUSDCBalance = ({
8181

8282
// Map TanStack Query states to the Status enum for API compatibility
8383
let status = Status.IDLE
84-
if (result.isLoading) {
84+
if (result.isPending) {
8585
status = Status.LOADING
8686
} else if (result.isError) {
8787
status = Status.ERROR

packages/web/src/pages/pay-and-earn-page/components/CashWallet.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
Text,
2222
IconButton,
2323
useMedia,
24-
motion
24+
Skeleton
2525
} from '@audius/harmony'
2626

2727
import { useModalState } from 'common/hooks/useModalState'
@@ -112,17 +112,13 @@ export const CashWallet = () => {
112112
</Flex>
113113

114114
{/* Balance Value */}
115-
<Text
116-
variant='display'
117-
size='m'
118-
color='default'
119-
css={{
120-
opacity: isLoading ? 0 : 1,
121-
transition: `opacity ${motion.calm}`
122-
}}
123-
>
124-
{balanceFormatted}
125-
</Text>
115+
{isLoading ? (
116+
<Skeleton w='unit24' h='unit10' />
117+
) : (
118+
<Text variant='display' size='m' color='default'>
119+
{balanceFormatted}
120+
</Text>
121+
)}
126122

127123
{/* Payout Wallet Info */}
128124
<Flex

0 commit comments

Comments
 (0)