Skip to content

Instantly share code, notes, and snippets.

@alexkuttig
Created March 24, 2018 14:14
Show Gist options
  • Save alexkuttig/ebd1465c9891d97530cc024881d94c61 to your computer and use it in GitHub Desktop.
Save alexkuttig/ebd1465c9891d97530cc024881d94c61 to your computer and use it in GitHub Desktop.
renderTitle = () => {
if (this.props.title) {
if (Platform.OS === 'ios') {
return (
<View style={[styles.iOSTitleContainer, {height: this.headerHeight}]}>
<Text style={styles.iOSTitle}>
{this.props.title}
</Text>
</View>
)
} else {
return (
<View style={[styles.androidTitleContainer, {height: this.headerHeight}]}>
<Text style={styles.androidTitle}>
{this.props.title}
</Text>
</View>
)
}
}
};
const styles: StyleSheet = StyleSheet.create({
iOSTitleContainer: {
width: 100 * vw,
alignItems: 'center',
justifyContent: 'flex-end',
borderBottomWidth: 1,
borderBottomColor: '#f2f2f2',
},
iOSTitle: {
marginBottom: 13,
fontSize: 17,
lineHeight: 17,
fontWeight: 'bold',
color: '#353535',
backgroundColor: 'rgba(0,0,0,0)'
},
androidTitleContainer: {
width: 100 * vw,
alignItems: 'flex-start',
justifyContent: 'flex-end',
borderBottomWidth: 1,
borderBottomColor: '#f2f2f2',
},
androidTitle: {
marginBottom: 16,
marginLeft: 72,
fontSize: 16,
lineHeight: 20,
fontWeight: 'bold',
color: '#353535',
backgroundColor: 'rgba(0,0,0,0)'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment