Created
May 25, 2018 12:10
-
-
Save renefs/f050ea197138e98f4dd1c7e573cb7a45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Text, View, StatusBar } from 'react-native' | |
import { PropTypes } from 'prop-types' | |
import { createStore } from 'redux' | |
import { Constants } from 'expo' | |
import { Provider } from 'react-redux' | |
import { createBottomTabNavigator, createStackNavigator } from 'react-navigation' | |
function entries (state = {}, action) { | |
} | |
class HomeScreen extends React.Component { | |
render () { | |
return ( | |
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'blue'}}> | |
<Text>Home!</Text> | |
</View> | |
) | |
} | |
} | |
class SettingsScreen extends React.Component { | |
render () { | |
return ( | |
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> | |
<Text>Settings</Text> | |
</View> | |
) | |
} | |
} | |
const tabNavigator = createBottomTabNavigator({ | |
Home: HomeScreen, | |
Settings: SettingsScreen, | |
}) | |
const MyStack = createStackNavigator( | |
{ | |
Root: tabNavigator | |
}, | |
{ | |
headerMode: 'none' | |
} | |
) | |
function AppStatusBar ({backgroundColor, ...props}) { | |
return ( | |
<View style={{backgroundColor, height: Constants.statusBarHeight}}> | |
<StatusBar translucent backgroundColor={backgroundColor} {...props} /> | |
</View> | |
) | |
} | |
class CustomNavigator extends React.Component { | |
static router = MyStack.router | |
render () { | |
const {navigation} = this.props | |
return ( | |
<Provider store={createStore(entries)}> | |
<View style={{flex: 1}}> | |
<AppStatusBar backgroundColor={'red'}/> | |
<MyStack navigation={navigation}/> | |
</View> | |
</Provider> | |
) | |
} | |
} | |
export default CustomNavigator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment