Skip to content

Commit bef723a

Browse files
committed
two todos still left on mobile
1 parent 1defcea commit bef723a

3 files changed

Lines changed: 58 additions & 97 deletions

File tree

src/screens/HomeScreen.tsx

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
import { Button, Center, Text } from '@baca/design-system'
22
import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks'
3-
import React from 'react'
4-
import { View, Linking, StyleSheet, ScrollView, Image, Dimensions } from 'react-native'
3+
import { View, Linking, StyleSheet } from 'react-native'
54

6-
import iphoneSettingsDraftDark from './iphone_settings_draft_dark.png'
7-
import iphoneSettingsDraftLight from './iphone_settings_draft_light.png'
8-
import iphoneSignupDraftDark from './iphone_signup_draft_dark.png'
9-
import iphoneSignupDraftLight from './iphone_signup_draft_light.png'
10-
11-
const imageSources = [
12-
iphoneSettingsDraftDark,
13-
iphoneSettingsDraftLight,
14-
iphoneSignupDraftDark,
15-
iphoneSignupDraftLight,
16-
]
5+
//TODO: Delete JSON we're not using
6+
//TODO: Add t internationalization for buttons
177

188
export const HomeScreen = () => {
199
const { t } = useTranslation()
@@ -37,7 +27,7 @@ export const HomeScreen = () => {
3727
h={12}
3828
minWidth={160}
3929
maxWidth={160}
40-
onPress={() => openLink('/docs/overview')}
30+
onPress={() => openLink('https://baca-docs.vercel.app/docs/overview')}
4131
>
4232
<Text.MdBold>Read docs</Text.MdBold>
4333
</Button>
@@ -51,24 +41,10 @@ export const HomeScreen = () => {
5141
<Text.MdBold>Try it</Text.MdBold>
5242
</Button.SecondaryColor>
5343
</View>
54-
<ScrollView
55-
horizontal
56-
pagingEnabled
57-
showsHorizontalScrollIndicator={false}
58-
style={styles.sliderContainer}
59-
centerContent
60-
decelerationRate={0.99}
61-
>
62-
{imageSources.map((source, index) => (
63-
<Image key={index} source={source} style={styles.sliderImage} />
64-
))}
65-
</ScrollView>
6644
</Center>
6745
)
6846
}
6947

70-
const { width } = Dimensions.get('window')
71-
7248
const styles = StyleSheet.create({
7349
buttonsContainer: {
7450
alignItems: 'center',
@@ -77,70 +53,4 @@ const styles = StyleSheet.create({
7753
justifyContent: 'center',
7854
marginTop: 16,
7955
},
80-
sliderContainer: {
81-
gap: 16,
82-
marginTop: 16,
83-
width: '100%',
84-
},
85-
sliderImage: {
86-
height: '100%',
87-
resizeMode: 'contain',
88-
width,
89-
},
9056
})
91-
92-
export default HomeScreen
93-
94-
// import { Button, Center, Text } from '@baca/design-system'
95-
// import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks'
96-
// import { View, Linking, StyleSheet } from 'react-native'
97-
98-
// export const HomeScreen = () => {
99-
// const { t } = useTranslation()
100-
101-
// useScreenOptions({
102-
// title: t('navigation.screen_titles.home'),
103-
// })
104-
105-
// const openLink = useCallback((url: string) => {
106-
// Linking.openURL(url)
107-
// }, [])
108-
109-
// return (
110-
// <Center flex={1} px={4}>
111-
// <Text.XxlBold textAlign="center">{t('home_header_title')}</Text.XxlBold>
112-
// <Text.LgRegular textAlign="center">{t('home_header_subtitle')}</Text.LgRegular>
113-
114-
// <View style={styles.buttonsContainer}>
115-
// <Button
116-
// m={3}
117-
// h={12}
118-
// minWidth={160}
119-
// maxWidth={160}
120-
// onPress={() => openLink('/docs/overview')}
121-
// >
122-
// <Text.MdBold>Read docs</Text.MdBold>
123-
// </Button>
124-
// <Button.SecondaryColor
125-
// m={3}
126-
// h={12}
127-
// minWidth={160}
128-
// maxWidth={160}
129-
// onPress={() => openLink('https://binarapps.online/sign-in')}
130-
// >
131-
// <Text.MdBold>Try it</Text.MdBold>
132-
// </Button.SecondaryColor>
133-
// </View>
134-
// </Center>
135-
// )
136-
// }
137-
138-
// const styles = StyleSheet.create({
139-
// buttonsContainer: {
140-
// alignItems: 'center',
141-
// flexDirection: 'row',
142-
// flexWrap: 'wrap',
143-
// justifyContent: 'center',
144-
// marginTop: 16,
145-
// },
146-
// })

src/screens/HomeScreen.web.tsx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { Button, Center, Text } from '@baca/design-system'
2+
import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks'
3+
import { View, Linking, StyleSheet } from 'react-native'
4+
5+
export const HomeScreen = () => {
6+
const { t } = useTranslation()
7+
8+
useScreenOptions({
9+
title: t('navigation.screen_titles.home'),
10+
})
11+
12+
const openLink = useCallback((url: string) => {
13+
Linking.openURL(url)
14+
}, [])
15+
16+
return (
17+
<Center flex={1} px={4}>
18+
<Text.XxlBold textAlign="center">{t('home_header_title')}</Text.XxlBold>
19+
<Text.LgRegular textAlign="center">{t('home_header_subtitle')}</Text.LgRegular>
20+
21+
<View style={styles.buttonsContainer}>
22+
<Button
23+
m={3}
24+
h={12}
25+
minWidth={160}
26+
maxWidth={160}
27+
onPress={() => openLink('https://baca-docs.vercel.app/docs/overview')}
28+
>
29+
<Text.MdBold>Read docs</Text.MdBold>
30+
</Button>
31+
<Button.SecondaryColor
32+
m={3}
33+
h={12}
34+
minWidth={160}
35+
maxWidth={160}
36+
onPress={() => openLink('https://binarapps.online/sign-in')}
37+
>
38+
<Text.MdBold>Try it</Text.MdBold>
39+
</Button.SecondaryColor>
40+
</View>
41+
</Center>
42+
)
43+
}
44+
45+
const styles = StyleSheet.create({
46+
buttonsContainer: {
47+
alignItems: 'center',
48+
flexDirection: 'row',
49+
flexWrap: 'wrap',
50+
justifyContent: 'center',
51+
marginTop: 16,
52+
},
53+
})

src/screens/LandingScreen.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { Button, Center, Text } from '@baca/design-system'
33
import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks'
44
import { router } from 'expo-router'
55

6-
//TODO: Ask Mateusz for which purpose does LandingScreen exist?
7-
86
export const LandingScreen = () => {
97
const { t } = useTranslation()
108

119
useScreenOptions({
12-
title: t('navigation.screen_titles.home'), //TODO: Delete JSON we're not using
10+
title: t('navigation.screen_titles.home'),
1311
})
1412

1513
const navigateToBlog = useCallback(() => {

0 commit comments

Comments
 (0)