-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddEventScreen.js
More file actions
139 lines (136 loc) · 3.73 KB
/
Copy pathAddEventScreen.js
File metadata and controls
139 lines (136 loc) · 3.73 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import React, { useState } from "react";
import {
Text,
View,
TouchableOpacity,
TextInput,
StyleSheet,
ScrollView,
SafeAreaView,
} from "react-native";
export default function AddEventScreen({ route, navigation }) {
const [title, setTitle] = useState("");
const [location, setLocation] = useState("");
const [date, setDate] = useState("");
const [startTime, setStartTime] = useState("");
const [endTime, setEndTime] = useState("");
const [bring, setBring] = useState("");
const [attire, setAttire] = useState("");
const [notes, setNotes] = useState("");
const event = route.params;
return (
// <View style={{ backgroundColor: "white" }}>
// <Text style={styles.screenTitle}>New Event</Text>
<SafeAreaView style={styles.containerBody}>
<ScrollView>
<View>
<Text style={styles.label}> Title: </Text>
<TextInput
style={styles.textInput}
value={title}
onChangeText={(newText) => setTitle(newText)}
/>
</View>
<View>
<Text style={styles.label}> Location: </Text>
<TextInput
style={styles.textInput}
value={location}
onChangeText={(newText) => setLocation(newText)}
/>
</View>
<View>
<Text style={styles.label}> Date: </Text>
<TextInput
style={styles.textInput}
value={date}
onChangeText={(newText) => setDate(newText)}
/>
</View>
<View>
<Text style={styles.label}> Start Time: </Text>
<TextInput
style={styles.textInput}
value={startTime}
onChangeText={(newText) => setStartTime(newText)}
/>
</View>
<View>
<Text style={styles.label}> End Time: </Text>
<TextInput
style={styles.textInput}
value={endTime}
onChangeText={(newText) => setEndTime(newText)}
/>
</View>
<View>
<Text style={styles.label}> To Bring: </Text>
<TextInput
style={styles.textInput}
value={bring}
onChangeText={(newText) => setBring(newText)}
/>
</View>
<View>
<Text style={styles.label}> Attire: </Text>
<TextInput
style={styles.textInput}
value={attire}
onChangeText={(newText) => setAttire(newText)}
/>
</View>
<View>
<Text style={styles.label}> Notes: </Text>
<TextInput
style={styles.textInput}
value={notes}
onChangeText={(newText) => setNotes(newText)}
/>
</View>
<TouchableOpacity
onPress={() =>
navigation.navigate("Events", { event: title, date: date })
}
>
<Text style={styles.addButton}> Add Event </Text>
</TouchableOpacity>
</ScrollView>
</SafeAreaView>
// </View>
// </View>
);
}
const styles = StyleSheet.create({
screenTitle: {
textAlign: "center",
marginTop: 20,
marginBottom: 20,
fontWeight: "bold",
},
containerBody: {
backgroundColor: "#E3EBEE",
},
textInput: {
marginLeft: 30,
borderWidth: 1,
width: "83%",
padding: 10,
borderColor: "#ccc",
height: 35,
},
label: {
marginTop: 30,
marginLeft: 30,
},
addButton: {
backgroundColor: "#0D532F",
color: "white",
textAlign: "center",
padding: 10,
marginLeft: 130,
marginRight: 130,
marginTop: 30,
borderRadius: 20,
marginBottom: 30,
},
});