Skip to content

Commit f24bb7f

Browse files
authored
Small mobile tweaks for m1 wallet page (#11975)
1 parent 6c33a68 commit f24bb7f

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

packages/common/src/messages/walletMessages.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ export const walletMessages = {
1212

1313
// YourCoins messages
1414
yourCoins: 'Your Coins',
15-
loading: '-- $AUDIO',
16-
dollarZero: '$0.00',
17-
loadingPrice: '$0.00 (loading...)',
1815
buySell: 'Buy/Sell'
1916
}

packages/mobile/src/screens/wallet-screen/components/CashWallet.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import {
1818
IconInfo,
1919
IconLogoCircleUSDC,
2020
Paper,
21+
Skeleton,
2122
Text
2223
} from '@audius/harmony-native'
23-
import LoadingSpinner from 'app/components/loading-spinner'
2424
import { make, track } from 'app/services/analytics'
2525

2626
export const CashWallet = () => {
@@ -46,10 +46,6 @@ export const CashWallet = () => {
4646
bottomSheetModalRef.current?.present()
4747
}, [])
4848

49-
if (isLoading) {
50-
return <LoadingSpinner />
51-
}
52-
5349
return (
5450
<>
5551
<Paper>
@@ -70,9 +66,13 @@ export const CashWallet = () => {
7066
/>
7167
</Flex>
7268

73-
<Text variant='display' size='m' color='default'>
74-
${balanceFormatted}
75-
</Text>
69+
{isLoading ? (
70+
<Skeleton h='4xl' w='5xl' />
71+
) : (
72+
<Text variant='display' size='m' color='default'>
73+
{balanceFormatted}
74+
</Text>
75+
)}
7676

7777
{!isManagedAccount ? (
7878
<Button variant='secondary' onPress={handleAddCash} fullWidth>

packages/mobile/src/screens/wallet-screen/components/YourCoins.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { useCallback } from 'react'
1+
import React, { useCallback } from 'react'
22

33
import { useFormattedAudioBalance } from '@audius/common/hooks'
4-
import { walletMessages } from '@audius/common/messages'
54

65
import {
76
Flex,
87
IconCaretRight,
98
IconTokenAUDIO,
109
Paper,
10+
Skeleton,
1111
Text,
1212
cornerRadius
1313
} from '@audius/harmony-native'
@@ -27,10 +27,6 @@ export const YourCoins = () => {
2727
navigation.navigate('AudioScreen')
2828
}, [navigation])
2929

30-
const displayAmount = isAudioBalanceLoading
31-
? walletMessages.loading
32-
: audioBalanceFormatted
33-
3430
return (
3531
<Paper onPress={handleTokenClick}>
3632
<Flex
@@ -43,18 +39,26 @@ export const YourCoins = () => {
4339
<IconTokenAUDIO size='4xl' borderRadius={cornerRadius.circle} />
4440
<Flex direction='column' gap='xs'>
4541
<Flex direction='row' alignItems='center' gap='xs'>
46-
<Text variant='heading' size='l' color='default'>
47-
{displayAmount}
48-
</Text>
49-
<Text variant='heading' size='l' color='subdued'>
50-
$AUDIO
51-
</Text>
42+
{isAudioBalanceLoading ? (
43+
<Skeleton h='4xl' w='5xl' />
44+
) : (
45+
<>
46+
<Text variant='heading' size='l' color='default'>
47+
{audioBalanceFormatted}
48+
</Text>
49+
<Text variant='heading' size='l' color='subdued'>
50+
$AUDIO
51+
</Text>
52+
</>
53+
)}
5254
</Flex>
53-
<Text variant='heading' size='s' color='subdued'>
54-
{isAudioPriceLoading
55-
? walletMessages.loadingPrice
56-
: audioDollarValue}
57-
</Text>
55+
{isAudioPriceLoading ? (
56+
<Skeleton h='l' w='3xl' />
57+
) : (
58+
<Text variant='heading' size='s' color='subdued'>
59+
{audioDollarValue}
60+
</Text>
61+
)}
5862
</Flex>
5963
</Flex>
6064
<IconCaretRight size='s' color='subdued' />

0 commit comments

Comments
 (0)