|
@@ -7,6 +7,7 @@ import SectionedMultiSelect from 'react-native-sectioned-multi-select';
|
7
|
7
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
8
|
8
|
import { connect } from 'react-redux';
|
9
|
9
|
import { bindActionCreators } from 'redux';
|
|
10
|
+import { Picker } from "@react-native-picker/picker";
|
10
|
11
|
|
11
|
12
|
import { fetchUser } from "../../redux/actions";
|
12
|
13
|
import { styles } from "../../config/styles";
|
|
@@ -16,13 +17,16 @@ export class AvailabilityScreen extends Component {
|
16
|
17
|
constructor(props) {
|
17
|
18
|
super(props);
|
18
|
19
|
this.state = {
|
|
20
|
+ //x : this.route.params.availabilityData.selectedItems,
|
|
21
|
+ //y : this.route.params.availabilityData.markedDates,
|
19
|
22
|
english: false,
|
20
|
23
|
spanish: false,
|
21
|
24
|
virtual: false,
|
22
|
25
|
face_to_face: false,
|
23
|
26
|
personal: false,
|
24
|
27
|
group: false,
|
25
|
|
- cities: [],
|
|
28
|
+ city: 'San Juan',
|
|
29
|
+ //cities: [],
|
26
|
30
|
selectedItems: [],
|
27
|
31
|
markedDates: {}
|
28
|
32
|
};
|
|
@@ -33,6 +37,12 @@ export class AvailabilityScreen extends Component {
|
33
|
37
|
};
|
34
|
38
|
|
35
|
39
|
componentDidMount(){
|
|
40
|
+ /*if (x != undefined){
|
|
41
|
+ this.setState({selectedItems : x});
|
|
42
|
+ };
|
|
43
|
+ if (y != undefined){
|
|
44
|
+ this.setState({markedDates : y});
|
|
45
|
+ }*/
|
36
|
46
|
this.props.fetchUser();
|
37
|
47
|
this.forceUpdate(() => {this.handleUpdate()})
|
38
|
48
|
};
|
|
@@ -40,10 +50,11 @@ export class AvailabilityScreen extends Component {
|
40
|
50
|
handleUpdate(){
|
41
|
51
|
const { currentUser } = this.props;
|
42
|
52
|
if (currentUser != undefined){
|
43
|
|
- if (currentUser.hasOwnProperty('selectedItems') && currentUser.hasOwnProperty('markedDates'))
|
|
53
|
+ if (currentUser.hasOwnProperty('selectedItems') && currentUser.hasOwnProperty('markedDates') && currentUser.hasOwnProperty('city'))
|
44
|
54
|
this.setState( {selectedItems: currentUser.selectedItems});
|
45
|
55
|
this.setState( {markedDates: currentUser.markedDates});
|
46
|
|
- }
|
|
56
|
+ this.setState({city: currentUser.city})
|
|
57
|
+ }
|
47
|
58
|
};
|
48
|
59
|
|
49
|
60
|
onSave(){
|
|
@@ -79,9 +90,9 @@ export class AvailabilityScreen extends Component {
|
79
|
90
|
}
|
80
|
91
|
}
|
81
|
92
|
}
|
82
|
|
- else{
|
|
93
|
+ /*else{
|
83
|
94
|
this.state.cities.push(value);
|
84
|
|
- }
|
|
95
|
+ }*/
|
85
|
96
|
})
|
86
|
97
|
firebase.firestore().collection('Interpreters')
|
87
|
98
|
.doc(firebase.auth().currentUser.uid)
|
|
@@ -123,6 +134,87 @@ export class AvailabilityScreen extends Component {
|
123
|
134
|
onSelectedItemsChange={this.onSelectedItemsChange}
|
124
|
135
|
selectedItems={this.state.selectedItems}
|
125
|
136
|
/>
|
|
137
|
+ <Picker selectedValue={this.state.city} onValueChange={(itemValue, itemIndex) => this.setState({city : itemValue})}>
|
|
138
|
+ <Picker.Item label='Adjuntas' value={'Adjuntas'}/>
|
|
139
|
+ <Picker.Item label='Aguada' value={'Aguada'}/>
|
|
140
|
+ <Picker.Item label='Adjuntas' value={'Adjuntas'}/>
|
|
141
|
+ <Picker.Item label='Aguadilla' value={'Aguadilla'}/>
|
|
142
|
+ <Picker.Item label='Aguas Buenas' value={'Aguas Buenas'}/>
|
|
143
|
+ <Picker.Item label='Aibonito' value={'Aibonito'}/>
|
|
144
|
+ <Picker.Item label='Arecibo' value={'Arecibo'}/>
|
|
145
|
+ <Picker.Item label='Arroyo' value={'Arroyo'}/>
|
|
146
|
+ <Picker.Item label='Añasco' value={'Añasco'}/>
|
|
147
|
+ <Picker.Item label='Barceloneta' value={'Barceloneta'}/>
|
|
148
|
+ <Picker.Item label='Barranquitas' value={'Barranquitas'}/>
|
|
149
|
+ <Picker.Item label='Bayamón' value={'Bayamón'}/>
|
|
150
|
+ <Picker.Item label='Cabo Rojo' value={'Cabo Rojo'}/>
|
|
151
|
+ <Picker.Item label='Caguas' value={'Caguas'}/>
|
|
152
|
+ <Picker.Item label='Camuy' value={'Camuy'}/>
|
|
153
|
+ <Picker.Item label='Canóvanas' value={'Canóvanas'}/>
|
|
154
|
+ <Picker.Item label='Carolina' value={'Carolina'}/>
|
|
155
|
+ <Picker.Item label='Cataño' value={'Cataño'}/>
|
|
156
|
+ <Picker.Item label='Cayey' value={'Cayey'}/>
|
|
157
|
+ <Picker.Item label='Ceiba' value={'Ceiba'}/>
|
|
158
|
+ <Picker.Item label='Ciales' value={'Ciales'}/>
|
|
159
|
+ <Picker.Item label='Cidra' value={'Cidra'}/>
|
|
160
|
+ <Picker.Item label='Coamo' value={'Coamo'}/>
|
|
161
|
+ <Picker.Item label='Comerío' value={'Comerío'}/>
|
|
162
|
+ <Picker.Item label='Corozal' value={'Corozal'}/>
|
|
163
|
+ <Picker.Item label='Culebra' value={'Culebra'}/>
|
|
164
|
+ <Picker.Item label='Dorado' value={'Dorado'}/>
|
|
165
|
+ <Picker.Item label='Fajardo' value={'Fajardo'}/>
|
|
166
|
+ <Picker.Item label='Florida' value={'Florida'}/>
|
|
167
|
+ <Picker.Item label='Guayama' value={'Guayama'}/>
|
|
168
|
+ <Picker.Item label='Guayanilla' value={'Guayanilla'}/>
|
|
169
|
+ <Picker.Item label='Guaynabo' value={'Guaynabo'}/>
|
|
170
|
+ <Picker.Item label='Gurabo' value={'Gurabo'}/>
|
|
171
|
+ <Picker.Item label='Guánica' value={'Guánica'}/>
|
|
172
|
+ <Picker.Item label='Hatillo' value={'Hatillo'}/>
|
|
173
|
+ <Picker.Item label='Hormigueros' value={'Hormigueros'}/>
|
|
174
|
+ <Picker.Item label='Humacao' value={'Humacao'}/>
|
|
175
|
+ <Picker.Item label='Isabela' value={'Isabela'}/>
|
|
176
|
+ <Picker.Item label='Jayuya' value={'Jayuya'}/>
|
|
177
|
+ <Picker.Item label='Juana Díaz' value={'Juana Díaz'}/>
|
|
178
|
+ <Picker.Item label='Juncos' value={'Juncos'}/>
|
|
179
|
+ <Picker.Item label='Lajas' value={'Lajas'}/>
|
|
180
|
+ <Picker.Item label='Lares' value={'Lares'}/>
|
|
181
|
+ <Picker.Item label='Las Marías' value={'Las Marías'}/>
|
|
182
|
+ <Picker.Item label='Las Piedras' value={'Las Piedras'}/>
|
|
183
|
+ <Picker.Item label='Loíza' value={'Loíza'}/>
|
|
184
|
+ <Picker.Item label='Luquillo' value={'Luquillo'}/>
|
|
185
|
+ <Picker.Item label='Manatí' value={'Manatí'}/>
|
|
186
|
+ <Picker.Item label='Maricao' value={'Maricao'}/>
|
|
187
|
+ <Picker.Item label='Maunabo' value={'Maunabo'}/>
|
|
188
|
+ <Picker.Item label='Mayagüez' value={'Mayagüez'}/>
|
|
189
|
+ <Picker.Item label='Moca' value={'Moca'}/>
|
|
190
|
+ <Picker.Item label='Morovis' value={'Morovis'}/>
|
|
191
|
+ <Picker.Item label='Naguabo' value={'Naguabo'}/>
|
|
192
|
+ <Picker.Item label='Naranjito' value={'Naranjito'}/>
|
|
193
|
+ <Picker.Item label='Orocovis' value={'Orocovis'}/>
|
|
194
|
+ <Picker.Item label='Patillas' value={'Patillas'}/>
|
|
195
|
+ <Picker.Item label='Peñuelas' value={'Peñuelas'}/>
|
|
196
|
+ <Picker.Item label='Ponce' value={'Ponce'}/>
|
|
197
|
+ <Picker.Item label='Quebradillas' value={'Quebradillas'}/>
|
|
198
|
+ <Picker.Item label='Rincón' value={'Rincón'}/>
|
|
199
|
+ <Picker.Item label='Rio Grande' value={'Rio Grande'}/>
|
|
200
|
+ <Picker.Item label='Sabana Grande' value={'Sabana Grande'}/>
|
|
201
|
+ <Picker.Item label='Salinas' value={'Salinas'}/>
|
|
202
|
+ <Picker.Item label='San Germán' value={'San Germán'}/>
|
|
203
|
+ <Picker.Item label='San Juan' value={'San Juan'}/>
|
|
204
|
+ <Picker.Item label='San Lorenzo' value={'San Lorenzo'}/>
|
|
205
|
+ <Picker.Item label='San Sebastián' value={'San Sebastián'}/>
|
|
206
|
+ <Picker.Item label='Santa Isabel' value={'Santa Isabel'}/>
|
|
207
|
+ <Picker.Item label='Toa Alta' value={'Toa Alta'}/>
|
|
208
|
+ <Picker.Item label='Toa Baja' value={'Toa Baja'}/>
|
|
209
|
+ <Picker.Item label='Trujillo Alto' value={'Trujillo Alto'}/>
|
|
210
|
+ <Picker.Item label='Utuado' value={'Utuado'}/>
|
|
211
|
+ <Picker.Item label='Vega Alta' value={'Vega Alta'}/>
|
|
212
|
+ <Picker.Item label='Vega Baja' value={'Vega Baja'}/>
|
|
213
|
+ <Picker.Item label='Vieques' value={'Vieques'}/>
|
|
214
|
+ <Picker.Item label='Villalba' value={'Villalba'}/>
|
|
215
|
+ <Picker.Item label='Yabucoa' value={'Yabucoa'}/>
|
|
216
|
+ <Picker.Item label='Yauco' value={'Yauco'}/>
|
|
217
|
+ </Picker>
|
126
|
218
|
<Button title='Save' onPress={() => {this.onSave()}}/>
|
127
|
219
|
</ScrollView>
|
128
|
220
|
);
|