Last active
April 22, 2017 10:29
-
-
Save drmas/44a836560e128746b49db0fc486c5cf1 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 { | |
View, | |
StatusBar, | |
Platform | |
} from 'react-native' | |
import {Scene, Router} from 'react-native-router-flux'; | |
import HomeScreen from './screens/home' | |
import ProductsScreen from './screens/products' | |
export default class App extends React.Component { | |
render() { | |
return <View style={styles.container} > | |
<StatusBar barStyle='light-content'/> | |
<Router> | |
<Scene key="root" | |
navigationBarStyle={styles.navBar} | |
titleStyle={styles.title}> | |
<Scene | |
key="home" | |
component={HomeScreen} | |
title="Open Commerce" | |
/> | |
<Scene | |
key="products" | |
component={ProductsScreen} | |
getTitle={props => props.name} | |
/> | |
</Scene> | |
</Router> | |
</View> | |
} | |
} | |
const styles = { | |
container: { | |
flex: 1, | |
marginTop: Platform.OS == 'android' ? 22 : 0 | |
}, | |
navBar: { | |
backgroundColor: '#52B9D1', | |
}, | |
title: { | |
color: 'white' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment