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 };
|