@@ -196,19 +196,19 @@ export default function FormPage() {
196
196
const [ startDate , setStartDate ] = useState ( getCurrentDate ( ) ) ;
197
197
const [ editMode , setEditMode ] = useState ( false )
198
198
199
- const editForm = ( ) => {
199
+ const editForm = async ( ) => {
200
200
if ( profile . email === applicantByEmail ?. email ) {
201
201
setEditMode ( true )
202
202
}
203
203
}
204
204
205
- useEffect ( ( ) => {
206
- editForm ( )
205
+ useEffect ( ( ) => {
206
+ editForm ( )
207
207
} )
208
-
208
+
209
209
return (
210
210
< Container >
211
- < Header title = "Applicants" />
211
+ < Header title = "Applicants" applicantId = { applicantByEmail ?. id . toString ( ) } />
212
212
< Paper sx = { { p : 2 } } >
213
213
< img src = "/HeaderImage.png" alt = "Wizeline" style = { { width : "100%" } } />
214
214
< Typography component = "div" variant = "h2" >
@@ -226,6 +226,12 @@ export default function FormPage() {
226
226
validator = { validator }
227
227
action = "./createapplicant"
228
228
method = "post"
229
+ defaultValues = { {
230
+ //TODO: add the selects info to edit the form
231
+
232
+ gender : editMode ? applicantByEmail ?. gender : ""
233
+
234
+ } }
229
235
>
230
236
< Grid container spacing = { 10 } >
231
237
< Grid item xs = { 6 } >
@@ -243,7 +249,7 @@ export default function FormPage() {
243
249
label = "I identify as:"
244
250
options = { [ "Male" , "Female" , "Non-binary" , "Prefer not to say" ] }
245
251
style = { { width : "100%" , marginBottom : "20px" } }
246
- value = { editMode ? applicantByEmail ?. gender : '' }
252
+
247
253
/>
248
254
< LabeledTextField
249
255
label = "Full Name"
@@ -275,7 +281,7 @@ export default function FormPage() {
275
281
"Vietnam" ,
276
282
] }
277
283
style = { { width : "100%" , marginBottom : "20px" } }
278
- value = { editMode ? applicantByEmail ?. country : '' }
284
+ // value={editMode ? applicantByEmail?.country : ''}
279
285
/>
280
286
< LabeledTextField
281
287
name = "dayOfBirth"
@@ -391,7 +397,7 @@ export default function FormPage() {
391
397
"Wife" ,
392
398
] }
393
399
style = { { width : "100%" , marginBottom : "20px" } }
394
- value = { editMode ? ( applicantByEmail ?. emergencyRelationship ?? '' ) : '' }
400
+ // value={editMode ? (applicantByEmail?.emergencyRelationship ?? '') : ''}
395
401
/>
396
402
< LabeledTextField
397
403
label = "Emergency phone number"
@@ -425,7 +431,7 @@ export default function FormPage() {
425
431
"Proficient (C1,C2)" ,
426
432
] }
427
433
style = { { width : "100%" , marginBottom : "20px" } }
428
- value = { editMode ? applicantByEmail ?. englishLevel : '' }
434
+ // value={editMode ? applicantByEmail?.englishLevel : ''}
429
435
/>
430
436
< LabeledTextField
431
437
label = "Degree and field you are studying"
@@ -486,7 +492,7 @@ export default function FormPage() {
486
492
"Project Management" ,
487
493
] }
488
494
style = { { width : "100%" , marginBottom : "20px" } }
489
- value = { editMode ? ( applicantByEmail ?. interestedRoles ?? '' ) : '' }
495
+ // value={editMode ? (applicantByEmail?.interestedRoles ?? '') : ''}
490
496
/>
491
497
< LabeledTextField
492
498
label = "Preferred tools, programs, frameworks, programming languages or libraries"
@@ -542,14 +548,14 @@ export default function FormPage() {
542
548
"University talk" ,
543
549
] }
544
550
style = { { width : "100%" , marginBottom : "20px" } }
545
- value = { editMode ? applicantByEmail ?. howDidYouHearAboutUs : '' }
551
+ // value={editMode ? applicantByEmail?.howDidYouHearAboutUs : ''}
546
552
/>
547
553
< SelectField
548
554
name = "participatedAtWizeline"
549
555
label = "Have you participated in any program at Wizeline before?"
550
556
options = { [ "Yes" , "No" ] }
551
557
style = { { width : "100%" , marginBottom : "20px" } }
552
- value = { editMode ? ( applicantByEmail ?. participatedAtWizeline ? 'true' : 'false' ) : '' }
558
+ // value={editMode ? (applicantByEmail?.participatedAtWizeline ? 'true' : 'false') : ''}
553
559
/>
554
560
< SelectField
555
561
name = "wizelinePrograms"
@@ -562,7 +568,7 @@ export default function FormPage() {
562
568
"Does not apply" ,
563
569
] }
564
570
style = { { width : "100%" , marginBottom : "20px" } }
565
- value = { editMode ? ( applicantByEmail ?. wizelinePrograms ?? '' ) : '' }
571
+ // value={editMode ? (applicantByEmail?.wizelinePrograms ?? '') : ''}
566
572
/>
567
573
< LabeledTextField
568
574
label = "Any additional comments?"
0 commit comments