diff options
Diffstat (limited to 'src/Main.js')
-rw-r--r-- | src/Main.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Main.js b/src/Main.js new file mode 100644 index 0000000..5a67c64 --- /dev/null +++ b/src/Main.js @@ -0,0 +1,35 @@ +import React, { Component } from 'react'; +import { Platform, StyleSheet, Text, View } from 'react-native'; +import { connect } from 'redux-su'; +import Login from './Components/Login'; +import Map from './Components/Map'; +import PortalPanel from './Components/PortalPanel'; +import { createStackNavigator, createAppContainer } from 'react-navigation'; + +const AppNavigator = createStackNavigator({ + Map: { + screen: Map, + navigationOptions: { + header: null, + } + }, + Portal: { + screen: PortalPanel, + navigationOptions: () => ({ + headerMode: 'float', + headerBackTitle: null + }) + }, +}); +const AppContainer = createAppContainer(AppNavigator) +class App extends Component { + render() { + return ( + <View style={{ flex: 1 }}> + {this.props.auth.user ? <AppContainer /> : <Login />} + </View> + ); + } +} + +export default connect({ 'auth': 'auth' }, {})(App)
\ No newline at end of file |