-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.js
42 lines (40 loc) · 1.17 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
import React, { Component } from 'react';
import { View, Text, StyleSheet, TextInput, TouchableOpacity } from 'react-native';
class Header extends 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?"
returnKeyType = "done"
blurOnSubmit = {false}
style = {styles.input}
/>
</View>
);
}
}
const styles = StyleSheet.create({
header: {
paddingHorizontal: 16,
flexDirection: "row",
justifyContent: "space-around",
alignItems: "center"
},
toggleIcon: {
fontSize: 30,
color: "#CCC"
},
input : {
flex: 1,
marginLeft: 16,
height: 50
}
})
export default Header;