From f47c3f4349cb68460dadf1fc381e3ceb52fe009a Mon Sep 17 00:00:00 2001
From: rohan09-raj <rajrohan1914@gmail.com>
Date: Fri, 19 Aug 2022 21:06:48 +0530
Subject: minor fixes

---
 client/src/pages/Enrollment/FormOne/FormOne.jsx | 26 ++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

(limited to 'client/src/pages/Enrollment/FormOne/FormOne.jsx')

diff --git a/client/src/pages/Enrollment/FormOne/FormOne.jsx b/client/src/pages/Enrollment/FormOne/FormOne.jsx
index 2754660..f601921 100644
--- a/client/src/pages/Enrollment/FormOne/FormOne.jsx
+++ b/client/src/pages/Enrollment/FormOne/FormOne.jsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React, { useEffect } from 'react'
 import { useTranslation } from 'react-i18next'
 import Header from '../../../components/Header/Header'
 import Input from '../../../components/Input/Input'
@@ -10,6 +10,26 @@ const FormOne = () => {
   const { t } = useTranslation()
   const { userData, setUserData } = userContext()
 
+  useEffect(() => {
+    switch (userData.gender) {
+      case 'Male':
+        document.getElementById('male').checked = 'checked'
+        break
+      case 'Female':
+        document.getElementById('female').checked = 'checked'
+        break
+      case 'Other':
+        document.getElementById('other').checked = 'checked'
+        break
+    }
+
+    if (userData.indianResident === true) {
+      document.getElementById('indian').checked = 'checked'
+    } else if (userData.indianResident === false) {
+      document.getElementById('non-resident-indian').checked = 'checked'
+    }
+  }, [userData.gender])
+
   return (
     <>
       <Header subheading={t('ENROLLMENT')} />
@@ -34,7 +54,7 @@ const FormOne = () => {
           <span className={styles.formone__resident}>
             <input
               type="radio"
-              id="indian"
+              id="non-resident-indian"
               name="resident"
               value={userData.indianResident}
               onChange={() => {
@@ -91,7 +111,7 @@ const FormOne = () => {
             image={`${process.env.PUBLIC_URL}/assets/images/female.svg`}
           />
           <LabelCard
-            id="trans"
+            id="other"
             name="gender"
             value={userData.gender}
             title={t('OTHER')}
-- 
cgit 

