Last active
April 15, 2018 03:36
-
-
Save b-tiwari/51f8e55f2ca24267e4dfbb7da88ebc3e to your computer and use it in GitHub Desktop.
App.tsx using Header
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 { StyleSheet, Text, View } from 'react-native'; | |
import Header from './components/header/header'; | |
export default class App extends React.Component { | |
render() { | |
const { container, header, content } = styles; | |
return ( | |
<View style={container}> | |
<View style={header}> | |
<Header title="Awesomest App Ever!!!" /> | |
</View> | |
<View style={content}> | |
<Text>Open up App.js to start working on your app!</Text> | |
<Text>Changes you make will automatically reload.</Text> | |
<Text>Shake your phone to open the developer menu.</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#eee', | |
justifyContent: 'center' | |
}, | |
header: { | |
flex: 1 | |
}, | |
content: { | |
flex: 6, | |
alignItems: 'center', | |
justifyContent: 'center' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment