-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
54 lines (46 loc) · 1.31 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
51
52
53
54
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
Navigator,
} from 'react-native';
import SplashPage from './scenes/SplashPage/SplashPage';
import FlexBox from './scenes/FlexBox/FlexBox';
// import InputField from './scenes/inputField';
import ROUTENAMES from './routes/routeNames';
export default class reactNativeWorkshop extends Component {
configureScene(route) {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FloatFromRight;
}
renderScene(route, navigator) {
if (route.id === ROUTENAMES.SPLASH_PAGE) {
return <SplashPage navigator={navigator} />;
}
if (route.id === ROUTENAMES.FLEX_BOX) {
return <FlexBox navigator={navigator} />;
}
return <FlexBox navigator={navigator} />;
}
constructor(props) {
super(props);
this.renderScene = this.renderScene.bind(this);
this.configureScene = this.configureScene.bind(this);
}
render() {
return (
<Navigator
initialRoute={{ id: ROUTENAMES.SPLASH_PAGE, name: 'Index' }}
renderScene={this.renderScene}
configureScene={this.configureScene}
/>
);
}
}
AppRegistry.registerComponent('reactNativeWorkshop', () => reactNativeWorkshop);