-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.android.js
50 lines (45 loc) · 1.29 KB
/
index.android.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
const React = require('react-native');
const {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
Image,
TouchableHighlight, TouchableOpacity
} = React;
import Game from './src/scenes/Game';
import MainMenu from './src/scenes/MainMenu';
import GameEnd from './src/scenes/GameEnd';
class kanaspeed extends React.Component {
renderScene(route, navigator) {
if (route.id === 'MainMenu') {
return <MainMenu navigator={navigator} route={route} />
}
if (route.id === 'Game') {
return <Game navigator={navigator}
route={route}
kanaTypes={route.kanaTypes}
/>
}
if (route.id === 'GameEnd') {
return <GameEnd numCorrect={route.numCorrect}
navigator={navigator}
time={route.time}
selected={route.selected}
question={route.question}
answer={route.answer}
kanaTypes={route.kanaTypes}
/>
}
}
render() {
return (
<Navigator style={{flex:1}}
initialRoute={{id: 'MainMenu', name: 'MainMenu', index: 0}}
renderScene={this.renderScene}
/>
);
}
}
AppRegistry.registerComponent('kanaspeed', () => kanaspeed);