33 lines
700 B
JavaScript
33 lines
700 B
JavaScript
import React from 'react-native';
|
|
|
|
import RouteMaster from './routes/RouteMaster';
|
|
|
|
const {
|
|
Navigator,
|
|
} = React;
|
|
|
|
export default class extends React.Component {
|
|
renderScene(route, nav) {
|
|
const props = route.props || {};
|
|
return <route.component nav={nav} {...props}/>;
|
|
}
|
|
|
|
componentWillMount() {
|
|
this.initialRoute = RouteMaster.get('LOGIN');
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Navigator
|
|
renderScene={this.renderScene}
|
|
initialRoute={this.initialRoute}
|
|
configureScene={(route) => {
|
|
if (route.sceneConfig) {
|
|
return route.sceneConfig;
|
|
}
|
|
return Navigator.SceneConfigs.PushFromRight;
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
};
|