summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaster4385 <venkateshchaturvedi12@gmail.com>2022-08-18 22:42:29 +0530
committerBlaster4385 <venkateshchaturvedi12@gmail.com>2022-08-18 22:42:29 +0530
commita06eec4ebb81ba77d4a8b03372a6312ffa5b2aa0 (patch)
tree4a30f638243ea220f670a16a42f2dc61779bda32
parent945a16740a36b616f7f2154ffe544f2d2fdbfabd (diff)
Fix gender input prefilling
-rw-r--r--client/src/components/Gender/Gender.jsx6
-rw-r--r--client/src/pages/Update/FormOne/FormOne.jsx7
2 files changed, 9 insertions, 4 deletions
diff --git a/client/src/components/Gender/Gender.jsx b/client/src/components/Gender/Gender.jsx
index 0079fc3..9b302a2 100644
--- a/client/src/components/Gender/Gender.jsx
+++ b/client/src/components/Gender/Gender.jsx
@@ -14,7 +14,7 @@ const Gender = ({ formData, setFormData }) => {
return (
<div className={styles.formone__gender}>
<LabelCard
- id="male"
+ id="Male"
name="gender"
title={t('MALE')}
value={formData?.gender}
@@ -28,7 +28,7 @@ const Gender = ({ formData, setFormData }) => {
image={`${process.env.PUBLIC_URL}/assets/images/male.svg`}
/>
<LabelCard
- id="female"
+ id="Female"
name="gender"
value={formData?.gender}
title={t('FEMALE')}
@@ -42,7 +42,7 @@ const Gender = ({ formData, setFormData }) => {
image={`${process.env.PUBLIC_URL}/assets/images/female.svg`}
/>
<LabelCard
- id="trans"
+ id="Other"
name="gender"
value={formData?.gender}
title={t('OTHER')}
diff --git a/client/src/pages/Update/FormOne/FormOne.jsx b/client/src/pages/Update/FormOne/FormOne.jsx
index fafce05..9c38d64 100644
--- a/client/src/pages/Update/FormOne/FormOne.jsx
+++ b/client/src/pages/Update/FormOne/FormOne.jsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React, { useEffect } from 'react'
import Header from '../../../components/Header/Header'
import UpdateInput from '../../../components/UpdateInput/UpdateInput'
import styles from './FormOne.module.css'
@@ -17,6 +17,11 @@ const FormOne = () => {
setEditable(!editable)
}
+ useEffect(() => {
+ console.log(userData.gender)
+ document.getElementById(`${userData.gender}`).checked = 'checked'
+ }, [userData.gender])
+
return (
<>
<Header subheading={t('UPDATE')} />