-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ios.js
77 lines (67 loc) · 2.14 KB
/
index.ios.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
import React from 'react'
import theme from './components/styles/theme'
import Login from './components/views/Login'
import TeacherPrepare from './components/views/TeacherPrepare'
import CheckAsTeacher from './components/views/CheckAsTeacher'
import CheckAsStudent from './components/views/CheckAsStudent'
import CheckAsStudentNoPic from './components/views/CheckAsStudentNoPic'
import Settings from './components/views/Settings'
const debug = true && __DEV__
import {
Text,
AppRegistry,
Navigator
} from 'react-native'
const NoBackSwipe = {
...Navigator.SceneConfigs.FloatFromBottom,
gestures: {
pop: {}
}
}
var CheckUAI = React.createClass({
async componentDidMount () {
// Orientation.lockToPortrait()
},
renderScene (route, navigator) {
console.log('rendering', route.id)
switch (route.id) {
case 'settings':
return <Settings debug={debug} navigator={navigator} />
case 'teacher-login':
return <Login debug={debug} navigator={navigator} />
case 'teacher-prepare':
return <TeacherPrepare debug={debug} navigator={navigator} {...route} />
case 'check-as-teacher':
return <CheckAsTeacher debug={debug} navigator={navigator} {...route}/>
case 'check-as-student':
return <CheckAsStudent debug={debug} navigator={navigator} {...route}/>
case 'check-as-student-no-pic':
return <CheckAsStudentNoPic debug={debug} navigator={navigator} {...route}/>
default:
return <Text>View not found</Text>
}
},
configureScene (route) {
switch (route.id) {
case 'settings':
return Navigator.SceneConfigs.VerticalDownSwipeJump
case 'check-as-student':
return NoBackSwipe
case 'check-as-student-no-pic':
return NoBackSwipe
default:
return Navigator.SceneConfigs.FloatFromRight
}
},
render () {
return (
<Navigator
initialRoute={{ id: 'teacher-login', index: 0 }}
renderScene={this.renderScene}
configureScene={this.configureScene}
style={theme.main.background} />
)
}
})
AppRegistry.registerComponent('CheckUAI', () => CheckUAI)
module.exports = CheckUAI