Skip to content

Instantly share code, notes, and snippets.

@renefs
Created May 25, 2018 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renefs/f050ea197138e98f4dd1c7e573cb7a45 to your computer and use it in GitHub Desktop.
Save renefs/f050ea197138e98f4dd1c7e573cb7a45 to your computer and use it in GitHub Desktop.
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