forked from briavicenti/concussion-management-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
90 lines (77 loc) · 2.59 KB
/
main.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
import Expo from 'expo';
import React from 'react';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import { StackNavigator } from 'react-navigation';
import { setCustomText } from 'react-native-global-props';
// begin
import Home from './screens/Home';
import GettingStarted from './screens/GettingStarted';
import Demo from './screens/Demo';
// Preseason Stuff
import PSHome from './screens/PSHome';
import CodeOfConduct from './screens/CodeOfConduct';
import ConcussionPolicy from './screens/ConcussionPolicy';
//import ConcussionVid from './screens/ConcussionVid';
import EdModules from './screens/EdModules'
// in season
import SHome from './screens/SHome';
import ReportConcussion from './screens/ReportConcussion';
import SymptomTest from './screens/SymptomTest';
import SymptomProgress from './screens/SymptomProgress';
const reducer = (state = {}, action) => {
switch(action.type) {
case 'MARK_COMPLETE':
return {...state, [action.section]: action.state};
case 'CHANGE_STAGE':
return {...state, [action.section]: action.state};
case 'MARK_INFO':
return {...state, [action.section]: action.state};
case 'UPDATE_USER_INFO':
return {...state, userInfo: action.state};
case 'UPDATE_CONCUSSION_INFO':
return {...state, concussionInfo: action.state};
case 'ADD_SYMPTOM_RATING':
return {...state, symptomRatings: {...state.symptomRatings, [action.symptom]: action.ratings}};
case 'ADD_REPORT_DATE':
return {...state, reportDates: action.dates};
case 'START_DEMO':
return {...state, userInfo: action.user, concussionInfo: action.concussion, symptomRatings: action.ratings, reportDates: action.dates}
default:
return state;
}
}
const store = createStore(reducer);
class App extends React.Component {
render() {
const customTextProps = {
style: {
fontFamily: 'Avenir',
fontSize: 18,
}
}
setCustomText(customTextProps);
return(
<Provider store={store}>
<AppNavigator/>
</Provider>
);
}
}
const AppNavigator = StackNavigator( {
Home: { screen: Home },
GettingStarted: { screen: GettingStarted },
Demo: { screen: Demo },
// Preseason items
PSHome: { screen: PSHome },
CodeOfConduct: { screen: CodeOfConduct },
ConcussionPolicy: { screen: ConcussionPolicy },
// Education modules
EdModules: { screen: EdModules },
// In Season
SHome: { screen: SHome },
ReportConcussion: { screen: ReportConcussion },
SymptomTest: { screen: SymptomTest },
SymptomProgress: { screen: SymptomProgress },
});
Expo.registerRootComponent(App);