-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
70 lines (66 loc) · 2.17 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
// Import Navigators from React Navigation
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { ThemeProvider } from 'react-native-elements';
import { COLORS } from './assets/AppStyles';
import DrawerNavigationRoutes from './screens/DrawerNavigationRoutes';
import Login from './screens/Login';
import Register from './screens/Register';
import SplashScreen from './screens/SplashScreen';
const Stack = createStackNavigator();
const Auth = () => {
// Stack Navigator for Login and Sign up Screen
return (
<Stack.Navigator initialRouteName="LoginScreen">
<Stack.Screen
name="LoginScreen"
component={Login}
options={{ headerShown: false }}
/>
<Stack.Screen
name="RegisterScreen"
component={Register}
options={{
title: 'Register', //Set Header Title
headerStyle: {
backgroundColor: COLORS.TE_PAPA_GREEN_COLOR, //Set Header color
},
headerTintColor: COLORS.WHITE_COLOR, //Set Header text color
headerTitleStyle: {
fontWeight: 'bold', //Set Header text style
},
}}
/>
</Stack.Navigator>
);
};
export default function App() {
return (
<ThemeProvider>
<NavigationContainer>
<Stack.Navigator initialRouteName="SplashScreen">
{/* SplashScreen which will come once for 5 Seconds */}
<Stack.Screen
name="SplashScreen"
component={SplashScreen}
// Hiding header for Splash Screen
options={{ headerShown: false }}
/>
{/* Auth Navigator: Include Login and Signup */}
<Stack.Screen
name="Auth"
component={Auth}
options={{ headerShown: false }}
/>
{/* Navigation Drawer as a landing page */}
<Stack.Screen
name="DrawerNavigationRoutes"
component={DrawerNavigationRoutes}
// Hiding header for Navigation Drawer
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
</ThemeProvider>
);
}