Created
December 15, 2017 14:44
-
-
Save rbhatia46/a5cc62c274a2447a9dcd3a1497df7814 to your computer and use it in GitHub Desktop.
Reusable Header Component for React Native
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, Text } from 'react-native'; | |
const Header = (props) => { | |
return ( | |
<View style={styles.viewStyle}> | |
<Text style={styles.textStyle}>{props.headerText}</Text> | |
</View> | |
); | |
}; | |
const styles = { | |
viewStyle: { | |
backgroundColor:#F7F7F7, | |
justifyContent : 'center', | |
alignItems:'center', | |
height:60, | |
paddingTop:15, | |
shadowColor:#000, | |
shadowOffset:{width:0, height:2}, | |
shadowOpacity:0.2, | |
elevation:2, | |
position:'relative' | |
}, | |
textStyle: { | |
fontSize:20 | |
} | |
}; | |
export default Header; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment