-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
86 lines (80 loc) · 2.33 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React from 'react'
import { View } from 'react-native'
import { NavigationContainer } from '@react-navigation/native'
import { ToastProvider } from 'react-native-toast-notifications'
import { useTranslation } from 'react-i18next';
import { BottomBar } from '~/components'
import {
AuthScreen,
FavoritesScreen,
HomeScreen,
InfoScreen,
MediaScreen,
ProfileScreen,
SearchScreen,
} from '~/screens'
import { BottomTab, Stack, linkingConfig } from '~/navigation'
import { theme } from '~/styles'
const BottomTabBar = () => {
const { t } = useTranslation();
return (<BottomTab.Navigator screenOptions={BottomBar}>
<BottomTab.Screen
name='Home'
component={HomeScreen}
options={{
tabBarLabel: t('bottomBar.home'),
}}
/>
<BottomTab.Screen
name='Search'
component={SearchScreen}
options={{
tabBarLabel: t('bottomBar.search'),
}}
/>
<BottomTab.Screen
name='Favorites'
component={FavoritesScreen}
options={{
tabBarLabel: t('bottomBar.favorites'),
}}
/>
<BottomTab.Screen
name='Profile'
component={ProfileScreen}
options={{
tabBarLabel: t('bottomBar.profile'),
}}
/>
</BottomTab.Navigator>)
}
const App = () => (
<NavigationContainer linking={linkingConfig} theme={theme}>
<ToastProvider swipeEnabled={true} normalColor={theme.colors.primary}>
<View style={wrapperStyle}>
<Stack.Navigator initialRouteName='Auth' screenOptions={{ headerShown: false }}>
<Stack.Screen name='BottomBar' component={BottomTabBar} />
<Stack.Screen
name='Media'
component={MediaScreen}
getId={({ params }) => `${params.id}`}
/>
<Stack.Screen
name='Search'
component={SearchScreen}
getId={({ params }) => `${params.id}`}
/>
<Stack.Screen
name='Favorites'
component={FavoritesScreen}
getId={({ params }) => `${params.id}`}
/>
<Stack.Screen name='Auth' component={AuthScreen} />
<Stack.Screen name='Info' component={InfoScreen} />
</Stack.Navigator>
</View>
</ToastProvider>
</NavigationContainer>
)
const wrapperStyle = { flexGrow: 1, backgroundColor: theme.colors.background }
export default App