-
Notifications
You must be signed in to change notification settings - Fork 6
/
TodoList.js
59 lines (57 loc) · 1.2 KB
/
TodoList.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
54
55
56
57
58
59
import React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import Icon from 'react-native-vector-icons/Feather';
export default function TodoList(props) {
return (
<View style={styles.listContainer}>
<Icon
name={props.checked ? 'check' : 'square'}
size={30}
color="black"
style={{ marginLeft: 15 }}
onPress={props.setChecked}
/>
<View>
{props.checked && <View style={styles.verticalLine} />}
<Text style={styles.listItem}>{props.text}</Text>
</View>
<Icon
name="trash-2"
size={30}
color="red"
style={{ marginLeft: 'auto' }}
onPress={props.deleteTodo}
/>
</View>
);
}
const styles = StyleSheet.create({
listContainer: {
marginTop: '5%',
flexDirection: 'row',
borderColor: '#aaaaaa',
borderBottomWidth: 1.5,
width: '100%',
alignItems: 'stretch',
minHeight: 40
},
listItem: {
paddingBottom: 20,
paddingLeft: 10,
marginTop: 6,
borderColor: 'green',
borderBottomWidth: 1,
fontSize: 17,
fontWeight: 'bold',
color: 'black'
},
verticalLine: {
borderBottomColor: 'green',
borderBottomWidth: 4,
marginLeft: 10,
width: '100%',
position: 'absolute',
marginTop: 15,
fontWeight: 'bold'
}
});