mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import React from 'react'
2import {StyleSheet, View, Dimensions} from 'react-native'
3import {useNavigation} from '@react-navigation/native'
4import {
5 FontAwesomeIcon,
6 FontAwesomeIconStyle,
7} from '@fortawesome/react-native-fontawesome'
8import {Text} from '../util/text/Text'
9import {Button} from '../util/forms/Button'
10import {NavigationProp} from 'lib/routes/types'
11import {usePalette} from 'lib/hooks/usePalette'
12import {s} from 'lib/styles'
13import {isWeb} from 'platform/detection'
14import {Trans} from '@lingui/macro'
15
16export function FollowingEndOfFeed() {
17 const pal = usePalette('default')
18 const palInverted = usePalette('inverted')
19 const navigation = useNavigation<NavigationProp>()
20
21 const onPressFindAccounts = React.useCallback(() => {
22 if (isWeb) {
23 navigation.navigate('Search', {})
24 } else {
25 navigation.navigate('SearchTab')
26 navigation.popToTop()
27 }
28 }, [navigation])
29
30 const onPressDiscoverFeeds = React.useCallback(() => {
31 if (isWeb) {
32 navigation.navigate('Feeds')
33 } else {
34 navigation.navigate('FeedsTab')
35 navigation.popToTop()
36 }
37 }, [navigation])
38
39 return (
40 <View
41 style={[
42 styles.container,
43 pal.border,
44 {minHeight: Dimensions.get('window').height * 0.75},
45 ]}>
46 <View style={styles.inner}>
47 <Text type="xl-medium" style={[s.textCenter, pal.text]}>
48 <Trans>
49 You've reached the end of your feed! Find some more accounts to
50 follow.
51 </Trans>
52 </Text>
53 <Button
54 type="inverted"
55 style={styles.emptyBtn}
56 onPress={onPressFindAccounts}>
57 <Text type="lg-medium" style={palInverted.text}>
58 <Trans>Find accounts to follow</Trans>
59 </Text>
60 <FontAwesomeIcon
61 icon="angle-right"
62 style={palInverted.text as FontAwesomeIconStyle}
63 size={14}
64 />
65 </Button>
66
67 <Text type="xl-medium" style={[s.textCenter, pal.text, s.mt20]}>
68 <Trans>You can also discover new Custom Feeds to follow.</Trans>
69 </Text>
70 <Button
71 type="inverted"
72 style={[styles.emptyBtn, s.mt10]}
73 onPress={onPressDiscoverFeeds}>
74 <Text type="lg-medium" style={palInverted.text}>
75 <Trans>Discover new custom feeds</Trans>
76 </Text>
77 <FontAwesomeIcon
78 icon="angle-right"
79 style={palInverted.text as FontAwesomeIconStyle}
80 size={14}
81 />
82 </Button>
83 </View>
84 </View>
85 )
86}
87const styles = StyleSheet.create({
88 container: {
89 flexDirection: 'row',
90 justifyContent: 'center',
91 paddingTop: 40,
92 paddingBottom: 80,
93 paddingHorizontal: 30,
94 borderTopWidth: 1,
95 },
96 inner: {
97 width: '100%',
98 maxWidth: 460,
99 },
100 emptyBtn: {
101 marginVertical: 20,
102 flexDirection: 'row',
103 alignItems: 'center',
104 justifyContent: 'space-between',
105 paddingVertical: 18,
106 paddingHorizontal: 24,
107 borderRadius: 30,
108 },
109})