Skip to content

Commit 4447537

Browse files
Add Send Button to home screen (#481)
2 parents 8eb8a05 + 35fa616 commit 4447537

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

packages/app/features/account/rewards/screen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
Button,
33
ButtonText,
44
Card,
5-
Container,
65
H1,
76
H2,
87
H3,

packages/app/features/home/__snapshots__/screen.test.tsx.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ exports[`HomeScreen 1`] = `
345345
{
346346
"alignItems": "center",
347347
"flexDirection": "row",
348+
"gap": 18,
349+
"justifyContent": "space-around",
348350
"paddingTop": 18,
349351
"width": "100%",
350352
}
@@ -565,6 +567,13 @@ exports[`HomeScreen 1`] = `
565567
</View>
566568
</View>
567569
</View>
570+
<View
571+
style={
572+
{
573+
"flex": 1,
574+
}
575+
}
576+
/>
568577
</View>
569578
</View>
570579
<View

packages/app/features/home/screen.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import {
99
Link,
1010
H3,
1111
Card,
12+
LinkButton,
1213
} from '@my/ui'
13-
import { IconPlus } from 'app/components/icons'
14+
import { IconArrowRight, IconPlus } from 'app/components/icons'
1415
import { coins } from 'app/data/coins'
1516
import { useRootScreenParams } from 'app/routers/params'
1617
import { useSendAccount } from 'app/utils/send-accounts'
@@ -20,9 +21,11 @@ import { TokenBalanceCard } from './TokenBalanceCard'
2021
import { TokenBalanceList } from './TokenBalanceList'
2122
import { TokenDetails } from './TokenDetails'
2223
import { X } from '@tamagui/lucide-icons'
24+
import { useSendAccountBalances } from 'app/utils/useSendAccountBalances'
2325

2426
export function HomeScreen() {
2527
const [queryParams, setParams] = useRootScreenParams()
28+
const { totalBalance } = useSendAccountBalances()
2629

2730
const selectedCoin = useCoinFromTokenParam()
2831
const { data: sendAccount, isLoading: sendAccountLoading } = useSendAccount()
@@ -77,8 +80,22 @@ export function HomeScreen() {
7780
<XStack w={'100%'} jc={'center'} ai="center" $lg={{ f: 1 }}>
7881
<TokenBalanceCard />
7982
</XStack>
80-
<XStack w={'100%'} ai={'center'} pt={'$4'}>
83+
<XStack w={'100%'} ai={'center'} pt={'$4'} jc="space-around" gap={'$4'}>
8184
<DepositPopover />
85+
{!!totalBalance && (
86+
<Stack f={1}>
87+
<LinkButton href={'/send'} theme="green" br="$4" px={'$3.5'} h={'$4.5'} bw={1}>
88+
<XStack w={'100%'} jc={'space-between'} ai={'center'} h="100%">
89+
<Button.Text fontWeight={'500'} textTransform={'uppercase'}>
90+
Send
91+
</Button.Text>
92+
<Button.Icon>
93+
<IconArrowRight size={'2.5'} />
94+
</Button.Icon>
95+
</XStack>
96+
</LinkButton>
97+
</Stack>
98+
)}
8299
</XStack>
83100
</Card>
84101
<Separator $gtLg={{ display: 'none' }} w={'100%'} />

0 commit comments

Comments
 (0)