1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

implemented own navigator

This commit is contained in:
Laurent Cozic
2017-07-14 18:49:14 +00:00
parent 4dc540e589
commit 18b5453146
14 changed files with 104 additions and 54 deletions

View File

@ -0,0 +1,36 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { View } from 'react-native';
import { _ } from 'lib/locale.js';
class AppNavComponent extends Component {
constructor() {
super();
this.screenCache_ = [];
}
render() {
if (!this.props.route) throw new Error('Route must not be null');
let route = this.props.route;
let Screen = this.props.screens[route.routeName].screen;
return (
<View style={{flex:1}}>
<Screen style={{backgroundColor: '#f00'}} navigation={{ state: route }} />
</View>
);
}
}
const AppNav = connect(
(state) => {
return {
route: state.route,
};
}
)(AppNavComponent)
export { AppNav };