-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
121 lines (114 loc) · 2.85 KB
/
App.js
File metadata and controls
121 lines (114 loc) · 2.85 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { StatusBar } from "expo-status-bar";
import React from "react";
import {
StyleSheet,
Text,
View,
TouchableOpacity,
FlatList,
Modal,
} from "react-native";
import { AntDesign } from "@expo/vector-icons";
import colors from "./Colors";
import tempData from "./tempData";
import TodoList from "./components/TodoList";
import AddListModal from "./components/AddListModal";
export default class App extends React.Component {
state = {
addTodoVisible: false,
};
toggleAddTodoModal() {
this.setState({
addTodoVisible: !this.state.addTodoVisible,
});
}
render() {
return (
<View style={styles.container}>
<Modal
animationType="slide"
visible={this.state.addTodoVisible}
onRequestClose={() => this.toggleAddTodoModal()}
>
<AddListModal closeModal={() => this.toggleAddTodoModal()} />
</Modal>
<View style={{ flexDirection: "row" }}>
<View style={styles.divider} />
<View style={styles.title}>
<Text
style={{
fontWeight: "200",
color: colors.blue,
fontSize: 22,
alignSelf: "center",
}}
>
What's Your Plan
</Text>
<Text
style={{
fontWeight: "bold",
color: colors.black,
fontSize: 25,
alignSelf: "center",
}}
>
Today
</Text>
</View>
<View style={styles.divider} />
</View>
<View style={{ marginVertical: 48 }}>
<TouchableOpacity
style={styles.addList}
onPress={() => this.toggleAddTodoModal()}
>
<AntDesign name="plus" size={16} color={colors.blue} />
</TouchableOpacity>
<Text style={styles.add}>Add List</Text>
</View>
<View style={{ height: 275, paddingLeft: 32 }}>
<FlatList
data={tempData}
keyExtractor={(item) => item.name}
horizontal={true}
showsHorizontalScrollIndicator={false}
renderItem={({ item }) => <TodoList list={item} />}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FFFFFF",
alignItems: "center",
justifyContent: "center",
},
divider: {
backgroundColor: colors.lightBlue,
height: 2,
flex: 1,
alignSelf: "center",
},
addList: {
borderWidth: 2,
borderColor: colors.lightBlue,
borderRadius: 50,
padding: 16,
alignItems: "center",
justifyContent: "center",
},
title: {
fontSize: 20,
marginHorizontal: 18,
},
add: {
color: colors.blue,
fontWeight: "700",
fontSize: 14,
marginTop: 8,
},
});