forked from hrr19-apollo/scripty
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.ios.js
108 lines (94 loc) · 3.03 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
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
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
StatusBar,
Dimensions,
Navigator
} from 'react-native';
import Header from './src/components/header';
import LessonTitleCard from './src/components/lessonTitleCard';
import LessonTitleCardList from './src/components/LessonTitleCardList';
import Login from './src/components/login';
import Lesson from './src/components/Lesson';
import LessonComplete from './src/components/LessonComplete';
import Profile from './src/components/profile';
import SignUpForm from './src/components/SignUpForm';
import SignInForm from './src/components/SignInForm';
import LessonDetail from './src/components/lessonDetail';
import LeaderboardList from './src/components/LeaderBoardList';
import Languages from './src/components/languages'
class scripty extends Component {
renderScene(route, navigator) {
const { name, passProps } = route;
if (name === 'LessonList') {
return (
<View style={{flex: 1}}>
<LessonTitleCardList navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
} else if (name === 'Home') {
return <Login navigator={navigator} {...passProps} />
} else if(name === 'Languages'){
return (
<View style={{flex: 1}}>
<Languages navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
}else if (name === 'Lesson') {
return (
<View style={{flex: 1}}>
<Lesson navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
} else if (name === 'LessonDetail'){
return (
<View style={{flex: 1}}>
<LessonDetail navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
}else if (name === 'LessonComplete') {
return (
<View style={{flex: 1}}>
<LessonComplete navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
} else if (name === 'Profile') {
return (
<View style={{flex: 1}}>
<Profile navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name}/>
</View>
)
} else if (name === 'Leaderboard') {
return (
<View style={{flex: 1}}>
<LeaderboardList navigator={navigator} {...passProps} />
<Header navigator={navigator} name={name} />
</View>
)
} else if (name === 'SignUp') {
return <SignUpForm navigator={navigator} {...passProps} />
} else if (name === 'LogIn') {
return <SignInForm navigator={navigator} {...passProps} />
}
}
render() {
return (
<Navigator
style={{ backgroundColor: 'white', flex: 1 }}
initialRoute={{ name:'Home' }}
renderScene={this.renderScene}
/>
)
}
};
AppRegistry.registerComponent('scripty', () => scripty);