|
a |
|
b/App.js |
|
|
1 |
import React from 'react'; |
|
|
2 |
import {NavigationContainer} from '@react-navigation/native'; |
|
|
3 |
import {createNativeStackNavigator} from '@react-navigation/native-stack'; |
|
|
4 |
import SplashScreen from './src/screens/SplashScreen'; |
|
|
5 |
import HomeScreen from './src/screens/HomeScreen'; |
|
|
6 |
import {StatusBar, View} from 'react-native'; |
|
|
7 |
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; |
|
|
8 |
import PredictScreen from './src/screens/PredictScreen'; |
|
|
9 |
import AntDesign from 'react-native-vector-icons/AntDesign'; |
|
|
10 |
|
|
|
11 |
import Entypo from 'react-native-vector-icons/Entypo'; |
|
|
12 |
import ResultScreen from './src/screens/ResultScreen'; |
|
|
13 |
import UserResult from './src/screens/UserResult'; |
|
|
14 |
|
|
|
15 |
const welcomeStack = createNativeStackNavigator(); |
|
|
16 |
const tab = createBottomTabNavigator(); |
|
|
17 |
|
|
|
18 |
const welcomeNavigator = () => { |
|
|
19 |
return ( |
|
|
20 |
<welcomeStack.Navigator> |
|
|
21 |
<welcomeStack.Screen |
|
|
22 |
name="SplashScreen" |
|
|
23 |
component={SplashScreen} |
|
|
24 |
options={{headerShown: false}} |
|
|
25 |
/> |
|
|
26 |
<welcomeStack.Screen |
|
|
27 |
name="HomeScreen" |
|
|
28 |
component={TabNavigator} |
|
|
29 |
options={{headerShown: false}} |
|
|
30 |
/> |
|
|
31 |
<welcomeStack.Screen |
|
|
32 |
name="UserResult" |
|
|
33 |
component={UserResult} |
|
|
34 |
options={{headerShown: false}} |
|
|
35 |
/> |
|
|
36 |
<welcomeStack.Screen |
|
|
37 |
name="ResultScreen" |
|
|
38 |
component={ResultScreen} |
|
|
39 |
options={{headerShown: false}} |
|
|
40 |
/> |
|
|
41 |
</welcomeStack.Navigator> |
|
|
42 |
); |
|
|
43 |
}; |
|
|
44 |
|
|
|
45 |
const TabNavigator = () => { |
|
|
46 |
return ( |
|
|
47 |
<tab.Navigator |
|
|
48 |
screenOptions={{ |
|
|
49 |
headerShown: false, |
|
|
50 |
tabBarStyle: {backgroundColor: '#1A2980'}, |
|
|
51 |
tabBarActiveTintColor: 'white', |
|
|
52 |
tabBarInactiveTintColor: '#26D0CE', |
|
|
53 |
tabBarLabelStyle: {fontSize: 18}, |
|
|
54 |
}}> |
|
|
55 |
<tab.Screen |
|
|
56 |
name="Home" |
|
|
57 |
component={HomeScreen} |
|
|
58 |
options={{ |
|
|
59 |
tabBarIcon: ({color, size}) => { |
|
|
60 |
return <AntDesign name="home" color={color} size={size} />; |
|
|
61 |
}, |
|
|
62 |
}} |
|
|
63 |
/> |
|
|
64 |
<tab.Screen |
|
|
65 |
name="Predict" |
|
|
66 |
component={PredictScreen} |
|
|
67 |
options={{ |
|
|
68 |
tabBarIcon: ({color, size}) => { |
|
|
69 |
return <Entypo name="awareness-ribbon" color={color} size={size} />; |
|
|
70 |
}, |
|
|
71 |
}} |
|
|
72 |
/> |
|
|
73 |
<tab.Screen |
|
|
74 |
name="Result" |
|
|
75 |
component={ResultScreen} |
|
|
76 |
options={{ |
|
|
77 |
tabBarIcon: ({color, size}) => { |
|
|
78 |
return <Entypo name="bar-graph" color={color} size={size} />; |
|
|
79 |
}, |
|
|
80 |
}} |
|
|
81 |
/> |
|
|
82 |
</tab.Navigator> |
|
|
83 |
); |
|
|
84 |
}; |
|
|
85 |
|
|
|
86 |
const App = () => { |
|
|
87 |
return ( |
|
|
88 |
<NavigationContainer> |
|
|
89 |
<StatusBar barStyle="light-content" backgroundColor="#26D0CE" /> |
|
|
90 |
<View style={{flex: 1}}>{welcomeNavigator()}</View> |
|
|
91 |
</NavigationContainer> |
|
|
92 |
); |
|
|
93 |
}; |
|
|
94 |
|
|
|
95 |
export default App; |