|
1 | | -import { BACA_APP_URL, BACA_DOCS_URL } from '@baca/constants' |
2 | | -import { Box, Button, Center, Text } from '@baca/design-system' |
| 1 | +import { CompanyLogo } from '@baca/components' |
| 2 | +import { Button, Center, Text } from '@baca/design-system' |
3 | 3 | import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks' |
4 | | -import { Linking } from 'react-native' |
| 4 | +import { router } from 'expo-router' |
5 | 5 |
|
6 | 6 | export const HomeScreen = () => { |
7 | 7 | const { t } = useTranslation() |
8 | | - |
9 | 8 | useScreenOptions({ |
10 | 9 | title: t('navigation.screen_titles.home'), |
11 | 10 | }) |
12 | 11 |
|
13 | | - const openLink = useCallback((url: string) => { |
14 | | - Linking.openURL(url) |
| 12 | + const navigateToDetails = useCallback(() => { |
| 13 | + router.navigate({ |
| 14 | + pathname: 'home/details', |
| 15 | + params: { user: 'example@example.com' }, |
| 16 | + }) |
| 17 | + }, []) |
| 18 | + const navigateToBlog = useCallback(() => { |
| 19 | + router.navigate('/blog') |
| 20 | + }, []) |
| 21 | + |
| 22 | + const navigateToBigForm = useCallback(() => { |
| 23 | + router.navigate('/big-form') |
15 | 24 | }, []) |
16 | 25 |
|
17 | 26 | return ( |
18 | 27 | <Center flex={1} px={4}> |
19 | | - <Text.XxlBold textAlign="center">{t('home_screen.header_title')}</Text.XxlBold> |
20 | | - <Text.LgRegular textAlign="center">{t('home_screen.header_subtitle')}</Text.LgRegular> |
21 | | - |
22 | | - <Box alignItems="center" flexDirection="row" flexWrap="wrap" justifyContent="center" mt={4}> |
23 | | - <Button h={12} m={3} maxWidth={160} minWidth={160} onPress={() => openLink(BACA_DOCS_URL)}> |
24 | | - {t('home_screen.read_docs')} |
25 | | - </Button> |
26 | | - <Button.SecondaryColor |
27 | | - h={12} |
28 | | - m={3} |
29 | | - maxWidth={160} |
30 | | - minWidth={160} |
31 | | - onPress={() => openLink(BACA_APP_URL)} |
32 | | - > |
33 | | - {t('home_screen.try_it')} |
34 | | - </Button.SecondaryColor> |
35 | | - </Box> |
| 28 | + <CompanyLogo /> |
| 29 | + <Text.MdBold textAlign="center">{t('hello')}</Text.MdBold> |
| 30 | + <Text.MdRegular textAlign="center">{t('thanks')}</Text.MdRegular> |
| 31 | + <Text.MdRegular textAlign="center">{t('app_information')}</Text.MdRegular> |
| 32 | + <Button mt={4} onPress={navigateToDetails}> |
| 33 | + {t('home_screen.details')} |
| 34 | + </Button> |
| 35 | + <Button mt={4} onPress={navigateToBigForm}> |
| 36 | + {t('landing_screen.go_to_form')} |
| 37 | + </Button> |
| 38 | + <Button mt={4} onPress={navigateToBlog}> |
| 39 | + {t('landing_screen.go_to_blog')} |
| 40 | + </Button> |
36 | 41 | </Center> |
37 | 42 | ) |
38 | 43 | } |
0 commit comments