1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-12 08:54:00 +02:00
joplin/ReactNativeClient/lib/components/app-nav.js

31 lines
596 B
JavaScript
Raw Normal View History

2017-07-14 20:49:14 +02:00
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { View } from 'react-native';
import { _ } from 'lib/locale.js';
class AppNavComponent extends Component {
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 (
2017-07-22 00:42:24 +02:00
<View style={{ flex: 1 }}>
<Screen navigation={{ state: route }} />
2017-07-14 20:49:14 +02:00
</View>
);
}
}
const AppNav = connect(
(state) => {
return {
route: state.route,
};
}
)(AppNavComponent)
export { AppNav };