-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHeader.js
50 lines (48 loc) · 1.26 KB
/
Header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react';
import {View, Text, StyleSheet, StatusBar, TouchableOpacity} from 'react-native';
import { FontAwesome } from '@expo/vector-icons';
export default class Header extends React.Component {
render() {
return (
<View style={styles.header}>
<StatusBar backgroundColor="lightseagreen" barStyle="light-content" />
<View style={styles.row}>
<TouchableOpacity disabled={!this.props.onLeftButtonPress} onPress={this.props.onLeftButtonPress}>
<View style={styles.leftButton}>
{this.props.onLeftButtonPress &&
<FontAwesome name="angle-left" size={32} color="white" />
}
</View>
</TouchableOpacity>
<Text style={styles.title}>
{this.props.title}
</Text>
<Text style={styles.rightButton}></Text>
</View>
</View>
)
}
}
const styles = StyleSheet.create({
header: {
height: 76,
backgroundColor: 'lightseagreen',
justifyContent: 'flex-end',
padding: 10,
},
title: {
color: 'white',
fontWeight: 'bold',
fontSize: 24,
},
row: {
flexDirection: 'row',
justifyContent: 'space-between',
},
leftButton: {
width: 32
},
rightButton: {
width: 32
},
});