forked from ib-sundeep/rn-netflix-clone
-
Notifications
You must be signed in to change notification settings - Fork 4
/
App.js
100 lines (95 loc) · 2.8 KB
/
App.js
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import React from 'react';
import { SafeAreaView, StatusBar } from 'react-native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
import { DarkTheme, NavigationContainer } from '@react-navigation/native';
import { Feather } from '@expo/vector-icons';
import { AppScreens } from 'utils/screen';
import AccountScreen from 'screens/account';
import DetailScreen from 'screens/detail';
import HomeScreen from 'screens/home';
import SearchScreen from 'screens/search';
import styles from 'utils/styles';
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
const AppTheme = {
...DarkTheme,
colors: {
...DarkTheme.colors,
background: styles.mainBackgroundColor,
primary: styles.primaryColor,
text: styles.defaultFontColor,
},
};
function TabsContainer() {
return (
<Tab.Navigator
tabBarOptions={{
activeTintColor: styles.defaultFontColor,
tabStyle: { padding: 5 },
style: {
backgroundColor: styles.mainBackgroundColor,
},
}}
>
<Tab.Screen
name={AppScreens.home}
component={HomeScreen}
options={{
tabBarLabel: 'Home',
tabBarIcon: ({ color }) => (
<Feather name="home" color={color} size={styles.tabBarIconSize} />
),
}}
/>
<Tab.Screen
name={AppScreens.search}
component={SearchScreen}
options={{
tabBarLabel: 'Search',
tabBarIcon: ({ color }) => (
<Feather name="search" color={color} size={styles.tabBarIconSize} />
),
}}
/>
<Tab.Screen
name={AppScreens.account}
component={AccountScreen}
options={{
tabBarLabel: 'Account',
tabBarIcon: ({ color }) => (
<Feather name="user" color={color} size={styles.tabBarIconSize} />
),
}}
/>
</Tab.Navigator>
);
}
export default function App() {
return (
<SafeAreaView
style={{ flex: 1, backgroundColor: styles.mainBackgroundColor }}
>
<StatusBar barStyle="light-content" />
<NavigationContainer theme={AppTheme}>
<Stack.Navigator>
<Stack.Screen
name={AppScreens.tabs}
component={TabsContainer}
options={{ headerShown: false }}
/>
<Stack.Screen
name={AppScreens.detail}
component={DetailScreen}
options={{
headerStyle: { backgroundColor: styles.mainBackgroundColor },
headerBackTitleVisible: false,
headerTitle: '',
headerTintColor: styles.defaultFontColor,
}}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
);
}