-
Notifications
You must be signed in to change notification settings - Fork 0
/
Header.js
40 lines (37 loc) · 991 Bytes
/
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
import React from 'react';
import { StyleSheet, Text, View, TextInput, TouchableOpacity } from 'react-native';
class Header extends React.Component {
render() {
return (
<View style={styles.header}>
<TouchableOpacity onPress={this.props.onToggleAllComplete}>
<Text style={styles.toggleIcon}>{String.fromCharCode(10003)}</Text>
</TouchableOpacity>
<TextInput
value={this.props.value}
onChangeText={this.props.onChange}
onSubmitEditing={this.props.onAddItem} placeholder="What needs to be done?" blurOnSubmit={true}
returnKeyType="done"
style={styles.input}
/>
</View>
);
}
}
const styles = StyleSheet.create({
header: {
paddingHorizontal: 16,
flexDirection: "row",
justifyContent: "space-around",
alignItems: "center"
},
toggleIcon: {
fontSize: 30
},
input: {
flex: 1,
height: 50,
marginLeft: 16
}
});
export default Header;