-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreateEvent.js
165 lines (147 loc) · 4.17 KB
/
CreateEvent.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TextInput,
ScrollView,
Dimensions,
TouchableNativeFeedback,
Picker,
CameraRoll
} from 'react-native';
import BasicSwitch from './Switch.js'
class CreateEvent extends Component {
constructor(props) {
super(props);
this.state = {
// username: null,
// password: null,
};
}
buttonClicked() {
fetch('http://10.0.3.2:8080', {
method: 'POST',
body: JSON.stringify({
eventName: this.state.eventName,
description: this.state.description,
category: this.state.category,
address: this.state.address,
location: this.state.location,
age: this.state.age,
homezip: this.state.homezip,
workzip: this.state.workzip,
})
});
}
render() {
return (
<View style={styles.container}>
<ScrollView style={{width: Dimensions.get('window').width}}>
<Text style={styles.welcome}>
Create Account
</Text>
<TextInput
style={{width: 300}}
placeholder="Event Name"
onChangeText={(eventName) => this.setState({eventName})}
value={this.state.eventName}
/>
<Text>{this.state.eventName}</Text>
<TextInput
multiline={true}
numberOfLines={3}
style={{width: 300}}
placeholder="Description"
onChangeText={(description) => this.setState({description})}
value={this.state.description}
/>
<Text>{this.state.description}</Text>
<TextInput
style={{width: 300}}
placeholder="Category"
onChangeText={(category) => this.setState({category})}
value={this.state.category}
/>
<Text>{this.state.category}</Text>
<TextInput
style={{width: 300}}
placeholder="location"
onChangeText={(location) => this.setState({location})}
value={this.state.location}
/>
<Text>{this.state.location}</Text>
<TextInput
style={{width: 300}}
placeholder="address"
onChangeText={(address) => this.setState({address})}
value={this.state.address}
/>
<Text>{this.state.address}</Text>
<Text>Private?</Text>
<BasicSwitch />
{/*WILL BE DIFFERENT FOR IOS*/}
<Picker
selectedValue={this.state.language}
onValueChange={(lang) => this.setState({language: lang})}>
<Picker.Item label="Java" value="java" />
<Picker.Item label="JavaScript" value="js" />
</Picker>
{/*<TextInput
style={{width: 300}}
placeholder="Bio"
onChangeText={(bio) => this.setState({bio})}
value={this.state.bio}
/>
<Text>{this.state.bio}</Text>
<TextInput
style={{width: 300}}
placeholder="Age"
onChangeText={(age) => this.setState({age})}
value={this.state.age}
/>
<Text>{this.state.age}</Text>
<TextInput
style={{width: 300}}
placeholder="Home Zip"
onChangeText={(homezip) => this.setState({homezip})}
value={this.state.homezip}
/>
<Text>{this.state.homezip}</Text>
<TextInput
style={{width: 300}}
placeholder="Work Zip"
onChangeText={(workzip) => this.setState({workzip})}
value={this.state.workzip}
/>
<Text>{this.state.workzip}</Text>*/}
</ScrollView>
<TouchableNativeFeedback onPress={this.buttonClicked.bind(this)} >
<View style={{width: 200, height: 50, backgroundColor: 'lightblue'}}>
<Text>Submit</Text>
</View>
</TouchableNativeFeedback>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
export default CreateEvent;