1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ReactNativeClient/lib/components/app-nav.js
2017-07-21 23:42:24 +01:00

31 lines
596 B
JavaScript

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 (
<View style={{ flex: 1 }}>
<Screen navigation={{ state: route }} />
</View>
);
}
}
const AppNav = connect(
(state) => {
return {
route: state.route,
};
}
)(AppNavComponent)
export { AppNav };