-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.js
53 lines (50 loc) · 1.77 KB
/
footer.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
51
52
53
import React, { Component } from 'react';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
class Footer extends Component {
render() {
const {filter} = this.props;
return (
<View style ={styles.container}>
<Text>{this.props.count} count</Text>
<View style = {styles.filters}>
<TouchableOpacity style = {[styles.filter, filter === "ALL" && styles.selected]}
onPress={()=> this.props.onFilter("ALL")}>
<Text>All</Text>
</TouchableOpacity >
<TouchableOpacity style = {[styles.filter, filter === "ACTIVE" && styles.selected]}
onPress={()=> this.props.onFilter("ACTIVE")}>
<Text>Active</Text>
</TouchableOpacity>
<TouchableOpacity style = {[styles.filter,filter === "COMPLETED" && styles.selected]}
onPress={()=> this.props.onFilter("COMPLETE")}>
<Text>Complete</Text>
</TouchableOpacity>
</View>
<TouchableOpacity onPress={this.props.onClearComplete}>
<Text> Clear Completed </Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
padding: 16,
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between"
},
filters: {
flexDirection: "row"
},
filter: {
padding: 8,
borderRadius: 5,
borderWidth: 1,
borderColor: "transparent"
},
selected: {
borderColor: "rgba(175, 47, 47, .2)"
}
})
export default Footer;