ActivityDetails.js
31.7 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
import { Formik } from "formik";
import { Fragment } from "react";
import { Button, Form } from "react-bootstrap";
import * as Yup from "yup";
const ActivityDetails = () => {
const activityDetailsValidationSchema = Yup.object().shape({
category: Yup.string()
.required("Category is Required"),
subcategory: Yup.string()
.required("SubCategory is Required"),
activity_name: Yup.string()
.required("Activity Name is Required"),
activity_description: Yup.string()
.required("Activity Description is Required"),
location: Yup.string()
.required("Location is Required"),
address: Yup.string()
.required("Address is Required"),
price_per_person: Yup.string()
.required("Price Per Person is Required"),
gifting_to_someone: Yup.string()
.required("Gifting to someone is Required"),
place: Yup.string()
.required("Place is Required"),
contact_person_for_activity: Yup.string()
.required("City is Required"),
min_group_size: Yup.string()
.required("Address Line 1 is Required"),
max_group_size: Yup.string()
.required("Address Line 2 is Required"),
month: Yup.string()
.required("Month is Required"),
min_duration: Yup.string()
.required("Month is Required"),
max_duration: Yup.string()
.required("Month is Required"),
link_of_booking: Yup.string()
.required("Link of Booking is Required"),
activity_images: Yup.array(),
contact_person_for_booking: Yup.string(),
contact_number_for_booking: Yup.string(),
cancellation_policy_file: Yup.string(),
terms_conditions_file: Yup.string(),
});
return (
<Fragment>
<div className="container p-5">
<div className="row">
<div className="col-12 col-lg-8">
<div className="content-div business-details">
<h2>Activity Details</h2>
<hr />
<div className="form-container">
<Formik
initialValues={{
category: "",
subcategory: "",
activity_name: "",
activity_description: "",
location: "",
address: "",
price_per_person: "",
gifting_to_someone: "",
place: "",
contact_person_for_activity: "",
min_group_size: "",
max_group_size: "",
month: "",
min_duration: "",
max_duration: "",
link_of_booking: "",
activity_images: [],
contact_person_for_booking: "",
contact_number_for_booking: "",
cancellation_policy_file: "",
terms_conditions_file: "",
}}
validationSchema={activityDetailsValidationSchema}
// enableReinitialize={true}
onSubmit={values => {
console.log("activity details values", values)
}}
>
{({ values, errors, touched, handleChange, handleBlur, handleSubmit }) => (
<Form
onSubmit={e => {
e.preventDefault();
handleSubmit();
}}
>
<h4>Activity Name 1</h4>
<div>
<p>Basic Details</p>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Enter Business PAN No.</label>
<select
id="category"
name="category"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="">Select</option>
<option value="Category 1">Category 1</option>
<option value="Category 2">Category 2</option>
</select>
{errors.category && touched.category && (<span className="form-error">{errors.category}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>SubCategory</label>
<select
id="subcategory"
name="subcategory"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="">Select</option>
<option value="Sub Category 1">Sub Category 1</option>
<option value="Sub Category 2">Sub Category 2</option>
</select>
{errors.subcategory && touched.subcategory && (<span className="form-error">{errors.subcategory}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Activity Name</label>
<input
type="text"
name="activity_name"
onChange={handleChange}
onBlur={handleBlur}
value={values.activity_name}
/>
{errors.activity_name && touched.activity_name && (<span className="form-error">{errors.activity_name}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Activity Description</label>
<input
type="text"
name="activity_description"
onChange={handleChange}
onBlur={handleBlur}
value={values.activity_description}
/>
{errors.activity_description && touched.activity_description && (<span className="form-error">{errors.activity_description}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Location</label>
<select
id="location"
name="location"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="">Select</option>
<option value="Location 1">Location 1</option>
<option value="Location 2">Location 2</option>
</select>
{errors.location && touched.location && (<span className="form-error">{errors.location}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Address</label>
<input
type="text"
name="address"
onChange={handleChange}
onBlur={handleBlur}
value={values.address}
/>
{errors.address && touched.address && (<span className="form-error">{errors.address}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Price (per person)</label>
<input
type="text"
name="price_per_person"
onChange={handleChange}
onBlur={handleBlur}
value={values.price_per_person}
/>
{errors.price_per_person && touched.price_per_person && (<span className="form-error">{errors.price_per_person}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Gifting to Someone</label>
<div className="row">
<div className="col-6 col-lg-6">
<label htmlFor="gifting_allowed">
<input
type="radio"
id="gifting_allowed"
name="gifting_to_someone"
onChange={handleChange}
onBlur={handleBlur}
value="gifting_allowed"
/> Allowed
</label>
</div>
<div className="col-6 col-lg-6">
<label htmlFor="gifting_disallowed">
<input
type="radio"
id="gifting_disallowed"
name="gifting_to_someone"
onChange={handleChange}
onBlur={handleBlur}
value="gifting_disallowed"
/> Disallowed
</label>
</div>
</div>
{errors.gifting_to_someone && touched.gifting_to_someone && (<span className="form-error">{errors.gifting_to_someone}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Place</label>
<div className="row">
<div className="col-4 col-lg-4">
<label htmlFor="indoor">
<input
type="radio"
id="indoor"
name="place"
onChange={handleChange}
onBlur={handleBlur}
value="indoor"
/> Indoor
</label>
</div>
<div className="col-4 col-lg-4">
<label htmlFor="outdoor">
<input
type="radio"
id="outdoor"
name="place"
onChange={handleChange}
onBlur={handleBlur}
value="outdoor"
/> Outdoor
</label>
</div>
<div className="col-4 col-lg-4">
<label htmlFor="both">
<input
type="radio"
id="both"
name="place"
onChange={handleChange}
onBlur={handleBlur}
value="both"
/> Both
</label>
</div>
</div>
{errors.place && touched.place && (<span className="form-error">{errors.place}</span>)}
</div>
</div>
</div>
</div>
<hr />
<div>
<p>Group Information</p>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Contact Person for the Activity</label>
<input
type="text"
name="contact_person_for_activity"
onChange={handleChange}
onBlur={handleBlur}
value={values.contact_person_for_activity}
/>
{errors.contact_person_for_activity && touched.contact_person_for_activity && (<span className="form-error">{errors.contact_person_for_activity}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Size of the Group</label>
<div className="row">
<div className="col-6 col-lg-6">
<div className="input-group mb-0">
<input
type="text"
name="min_group_size"
onChange={handleChange}
onBlur={handleBlur}
value={values.min_group_size}
/>
{errors.min_group_size && touched.min_group_size && (<span className="form-error">{errors.min_group_size}</span>)}
</div>
</div>
<div className="col-6 col-lg-6">
<div className="input-group mb-0">
<input
type="text"
name="max_group_size"
onChange={handleChange}
onBlur={handleBlur}
value={values.max_group_size}
/>
{errors.max_group_size && touched.max_group_size && (<span className="form-error">{errors.max_group_size}</span>)}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr />
<div>
<p>Availability</p>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Months</label>
<select
id="month"
name="month"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="">Select</option>
<option value="Location 1">Location 1</option>
<option value="Location 2">Location 2</option>
</select>
{errors.contact_person_for_activity && touched.contact_person_for_activity && (<span className="form-error">{errors.contact_person_for_activity}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Size of the Group</label>
<div className="row">
<div className="col-6 col-lg-6">
<div className="input-group mb-0">
<input
type="text"
name="min_group_size"
onChange={handleChange}
onBlur={handleBlur}
value={values.min_group_size}
/>
{errors.min_group_size && touched.min_group_size && (<span className="form-error">{errors.min_group_size}</span>)}
</div>
</div>
<div className="col-6 col-lg-6">
<div className="input-group mb-0">
<input
type="text"
name="max_group_size"
onChange={handleChange}
onBlur={handleBlur}
value={values.max_group_size}
/>
{errors.max_group_size && touched.max_group_size && (<span className="form-error">{errors.max_group_size}</span>)}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div className="row mb-5">
<div className="col-12 col-lg-5">
<div className="input-group">
<Button type="submit" className="btn btn-primary btn-submit">
Send for Approval
</Button>
</div>
</div>
</div>
</Form>
)}
</Formik>
</div>
</div>
</div>
<div className="col-12 col-lg-4">
<div className="content-div help-center">
<h2>Help Center</h2>
<ul className="helplist">
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/call.svg" className="img-fluid" />
<p>+1 (407) 8798 789</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</Fragment >
)
}
export default ActivityDetails;