You've already forked joplin
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:
36
ReactNativeClient/lib/components/app-nav.js
Normal file
36
ReactNativeClient/lib/components/app-nav.js
Normal 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 };
|
Reference in New Issue
Block a user