forked from IBMLLab/InDO-Mobile-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
124 lines (110 loc) · 3.74 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import { createAppContainer,createSwitchNavigator } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createMaterialTopTabNavigator } from "react-navigation-tabs";
import { Provider as AuthProvider } from "./src/context/AuthContext";
import { Provider as UserInputProvider } from "./src/context/UserInputContext";
import { Provider as FitbitUserProvider} from "./src/context/FitbitUserContext";
import StartScreen from "./src/screens/StartingScreen";
import LoginScreen from "./src/screens/LoginScreen";
import HistoryScreen from "./src/screens/HistoryScreen";
import UserInputScreen from "./src/screens/UserInputScreen";
import UserProfileScreen from "./src/screens/UserProfileScreen";
import SosScreen from "./src/screens/SosScreen";
import FitbitScreen from "./src/screens/FitbitScreen";
import GoogleFitScreen from "./src/screens/GoogleFitScreen";
import { setNavigator } from "./src/navigationRef";
import LoadingScreen from "./src/screens/LoadingScreen";
import UserProfileEditScreen from "./src/screens/UserProfileEditScreen";
import AddSosContactScreen from "./src/screens/AddSosContactScreen";
import ForgetPasswordScreen from "./src/screens/ForgetPasswordScreen";
import OtpVerificationScreen from "./src/screens/OtpVerificationScreen";
import NewPasswordScreen from "./src/screens/NewPasswordScreen";
import FitbitUserProfileScreen from "./src/screens/FitbitUserProfileScreen";
const switchNavigator = createSwitchNavigator({
Loading:LoadingScreen,
loginFlow:createStackNavigator({
'Start':StartScreen,
'Login':LoginScreen,
forgotPassword:ForgetPasswordScreen,
otpVerification:OtpVerificationScreen,
NewPassword:NewPasswordScreen,
},{
defaultNavigationOptions:{
title:'InDo App'
}
}),
mainFlow:createMaterialTopTabNavigator({
Status:HistoryScreen,
UserInput:UserInputScreen,
Settings:createStackNavigator({
UserProfile:{
screen:UserProfileScreen,
navigationOptions:{
title:'User Profile'
}
},
UserProfileEdit:{
screen:UserProfileEditScreen,
navigationOptions:{
title:'Profile Edit'
}
},
Fitbit:FitbitScreen,
FitbitUserProfile:{
screen:FitbitUserProfileScreen,
navigationOptions: {
title: 'Fitbit User Profile',
headerLeft: ()=> null,
}
},
GoogleFit:GoogleFitScreen,
}),
Sos:createStackNavigator({
SOS:SosScreen,
SOSContactAdd:{
screen:AddSosContactScreen,
navigationOptions:{
title:'Add SOS Contact'
}
},
})
},{
tabBarOptions: {
labelStyle: {
fontSize:12,
},
tabStyle: {
height:80,
paddingTop:30,
},
style: {
backgroundColor:'#6C63FF',
borderColor: 'white',
},
}
})
},{
initialRouteName : 'Loading',
});
// const navigator = createStackNavigator({
// 'Start':StartScreen,
// 'Login':LoginScreen,
// 'History':HistoryScreen,
// },{
// initialRouteName : 'Start',
// defaultNavigationOptions:{
// title:'InDo App'
// }
// });
const App = createAppContainer(switchNavigator);
export default () => {
return (
<AuthProvider>
<UserInputProvider>
<FitbitUserProvider>
<App ref={(navigator) =>{setNavigator(navigator)}}/>
</FitbitUserProvider>
</UserInputProvider>
</AuthProvider>
)
};