forked from mujahidfa/SAFEwalk-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
58 lines (58 loc) · 1.88 KB
/
example.js
File metadata and controls
58 lines (58 loc) · 1.88 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
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={styles.container}>
<View style={styles.innerContainer}>
{/* User Start and End Location input fields */}
<View style={styles.inputContainer}>
{errors.startLocation && (
<Text style={style.textError}>Start location is required.</Text>
)}
<Input
inputStyle={styles.inputStyle}
inputContainerStyle={styles.inputContainerStyleTop}
containerStyle={styles.containerStyle}
placeholder="Start Location"
ref={register({ name: "startLocation" }, { required: true })}
value={location}
onChangeText={(text) => {
changeLocation("start", text);
}}
leftIcon={{
type: "font-awesome",
name: "map-marker",
}}
/>
</View>
<View style={styles.inputContainer}>
{errors.endLocation && (
<Text style={style.textError}>Destination is required.</Text>
)}
<Input
inputStyle={styles.inputStyle}
inputContainerStyle={styles.inputContainerStyleBottom}
containerStyle={styles.containerStyle}
placeholder="Destination"
ref={register({ name: "endLocation" }, { required: true })}
value={destination}
onChangeText={(text) => {
changeLocation("end", text);
}}
leftIcon={{
type: "font-awesome",
name: "map-marker",
}}
/>
</View>
{/* Google Map */}
<MapView style={styles.mapStyle} />
{/* Button to Submit Request */}
<View style={styles.buttonContainer}>
<Button
title="Request Now"
onPress={() => addRequest()}
loading={isLoading}
disabled={isLoading}
/>
</View>
</View>
</View>
</TouchableWithoutFeedback>;