diff options
author | Blaster4385 <venkateshchaturvedi12@gmail.com> | 2022-08-25 11:44:08 +0530 |
---|---|---|
committer | Blaster4385 <venkateshchaturvedi12@gmail.com> | 2022-08-25 11:44:08 +0530 |
commit | fcc4c3374d85b33755f852bcc559db0a8eb5115a (patch) | |
tree | 266005279ac7996b479e2cb3b5d48ccebd041290 /client/src/pages/Update | |
parent | 3450e5ad9c59403b9ad75aa24e71a1b925f7bbcf (diff) |
Misc changes and add more translation
Diffstat (limited to 'client/src/pages/Update')
-rw-r--r-- | client/src/pages/Update/Address/Address.jsx | 18 | ||||
-rw-r--r-- | client/src/pages/Update/Agreement/Agreement.jsx | 24 | ||||
-rw-r--r-- | client/src/pages/Update/Biometric/Biometric.jsx | 2 | ||||
-rw-r--r-- | client/src/pages/Update/BiometricSelect/BiometricSelect.jsx | 10 | ||||
-rw-r--r-- | client/src/pages/Update/DocumentScanner/DocumentScanner.jsx | 19 | ||||
-rw-r--r-- | client/src/pages/Update/FormOne/FormOne.jsx | 24 | ||||
-rw-r--r-- | client/src/pages/Update/Otp/Otp.jsx | 20 | ||||
-rw-r--r-- | client/src/pages/Update/PhotoCapture/PhotoCapture.jsx | 15 |
8 files changed, 44 insertions, 88 deletions
diff --git a/client/src/pages/Update/Address/Address.jsx b/client/src/pages/Update/Address/Address.jsx index 0af60a5..39d3f13 100644 --- a/client/src/pages/Update/Address/Address.jsx +++ b/client/src/pages/Update/Address/Address.jsx @@ -55,28 +55,18 @@ const Address = () => { setEditable2(!editable2) } + const description = ['UPDATE_THE_REQUIRED_DETAILS_IN_THE_RELEVANT_FIELDS_BY_CLICKING_THE_EDIT_BUTTON', 'IF_REQUIRED_SELECT_THE_STATE_YOU_BELONG_TO_FROM_THE_DROPDOWN_LIST', 'IF_REQUIRED_SELECT_THE_DISTRICT_YOU_BELONG_TO_FROM_THE_DROPDOWN_LIST_THIS_WONT_SHOW_ANY_OPTIONS_UNTIL_YOU_HAVE_SELECTED_THE_STATE'] + return ( <> <Header subheading={t('UPDATE')} /> <PopUpModal - title="Fill your information" + title="FILL_YOUR_INFORMATION" image={`${process.env.PUBLIC_URL}/assets/images/address.svg`} description={ <> <ul> - <li className="list__item"> - Update the required details in the relevant fields by clicking - the edit button - </li> - <li className="list__item"> - If required, select the state you belong to. from the dropdown - list - </li> - <li className="list__item"> - If required, select the district you belong to. from the - dropdown list. This won't show any options until you have - selected the state - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } diff --git a/client/src/pages/Update/Agreement/Agreement.jsx b/client/src/pages/Update/Agreement/Agreement.jsx index 22ffa80..720d8a0 100644 --- a/client/src/pages/Update/Agreement/Agreement.jsx +++ b/client/src/pages/Update/Agreement/Agreement.jsx @@ -13,6 +13,8 @@ import { useMutation } from 'react-query' import { ToastContainer, toast } from 'react-toastify' import PopUpModal from '../../../components/Modal/Modal' import 'react-toastify/dist/ReactToastify.css' +import Error from '../../Error/Error' +import Spinner from '../../../components/Spinner/Spinner' const Agreement = () => { const { t } = useTranslation() @@ -32,6 +34,12 @@ const Agreement = () => { mobile: `+91${userData.mobile}`, id: userData._id }) + }, + onLoading: () => { + return <Spinner heading='UPDATE' /> + }, + onError: () => { + return <Error message={t('SOMETHING_WENT_WRONG_PLEASE_TRY_AGAIN')} /> } } ) @@ -73,6 +81,8 @@ const Agreement = () => { }, 30000) } + const description = ['CLICK_ON_SEND_OTP', 'YOU_WILL_RECIEVE_AN_OTP_ON_YOUR_MOBILE_NUMBER', 'YOU_CAN_RESEND_THE_OTP_AFTER_30_SECONDS_IF_YOU_HAVENT_RECEIVED_IT_YET', 'CLICK_ON_VERIFY_OTP_TO_VERIFY_YOUR_MOBILE_NUMBER'] + return ( <> <ToastContainer @@ -82,22 +92,12 @@ const Agreement = () => { /> <Header subheading={t('ENROLLMENT')} /> <PopUpModal - title="Verify your mobile number" + title="VERIFY_YOUR_MOBILE_NUMBER" image={`${process.env.PUBLIC_URL}/assets/images/agreement.svg`} description={ <> <ul> - <li className="list__item">Click on "SEND OTP"</li> - <li className="list__item"> - You will recieve an OTP on your entered mobile number - </li> - <li className="list__item"> - You can "RESEND" the OTP after 30 seconds, if you - haven't received it yet. - </li> - <li className="list__item"> - Click on "VERIFY OTP" to verify your mobile number - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } diff --git a/client/src/pages/Update/Biometric/Biometric.jsx b/client/src/pages/Update/Biometric/Biometric.jsx index 10b2776..f8bf028 100644 --- a/client/src/pages/Update/Biometric/Biometric.jsx +++ b/client/src/pages/Update/Biometric/Biometric.jsx @@ -82,7 +82,7 @@ const Biometric = () => { setUserData({ ...userData, photo: oriUserData.photo }) } else if ( predictions[0].class === 'person' && - predictions[0].score > 0.8 + predictions[0].score > 0.7 ) { setPage(4) } else { diff --git a/client/src/pages/Update/BiometricSelect/BiometricSelect.jsx b/client/src/pages/Update/BiometricSelect/BiometricSelect.jsx index a942aef..89d2bfb 100644 --- a/client/src/pages/Update/BiometricSelect/BiometricSelect.jsx +++ b/client/src/pages/Update/BiometricSelect/BiometricSelect.jsx @@ -8,21 +8,17 @@ import { useTranslation } from 'react-i18next' const BiometricSelect = ({ page, setPage }) => { const { t } = useTranslation() + const description = ['CLICK_ON_THE_EDIT_BUTTON_TO_UPDATE_THE_REQUIRED_BIOMETRICS', 'YOU_CAN_EDIT_YOUR_PHOTOGRAPH_/_FINGERPRINTS_/_IRIS_SCANS'] return ( <> <Header subheading={t('UPDATE')} /> <PopUpModal - title="Select the option to be edited" + title="SELECT_THE_OPTION_TO_BE_EDITED" image={`${process.env.PUBLIC_URL}/assets/images/biometrics.svg`} description={ <> <ul> - <li className="list__item"> - Click on the edit button to update the required biometrics - </li> - <li className="list__item"> - You can edit your Photograph/Fingerprints/Iris Scans - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } diff --git a/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx b/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx index c4f8ad6..e4bffc9 100644 --- a/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx +++ b/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx @@ -199,31 +199,30 @@ const DocumentScanner = () => { return ( <> <Header subheading={t('UPDATE')} /> - <PopUpModal - title="Scan your documents" + {steps.length !== 0 && (<PopUpModal + title="SCAN_YOUR_DOCUMENTS" image={`${process.env.PUBLIC_URL}/assets/images/document.svg`} description={ <> <ul> <li className="list__item"> - Consists of 3 steps : + {t('CONSISTS_OF_3_STEPS')} <ul> - <li>Proof of Identity: </li> - <li>Proof of Address: </li> - <li>Proof of Date of Birth: </li> + <li>{t('PROOF_OF_IDENTITY')} </li> + <li>{t(t('PROOF_OF_ADDRESS'))}</li> + <li>{t('PROOF_OF_DOB')} </li> </ul> </li> <li className="list__item"> - Ensure that your documents are in the center of the frame + {t('ENSURE_THAT_YOUR_DOCUMENTS_ARE_IN_THE_CENTER_OF_THE_FRAME')} </li> <li className="list__item"> - You won't be able to proceed until you have scanned all the - required documents + {t('YOU_WONT_BE_ABLE_TO_PROCEED_UNTIL_YOU_HAVE_SCANNED_ALL_THE_REQUIRED_DOCUMENTS')} </li> </ul> </> } - /> + />)} <div className={styles.stepper__container}> <div className={styles.box}> <Stepper activeStep={activeStep} sx={{ width: '60%' }}> diff --git a/client/src/pages/Update/FormOne/FormOne.jsx b/client/src/pages/Update/FormOne/FormOne.jsx index 2c61fb9..fc7ec1c 100644 --- a/client/src/pages/Update/FormOne/FormOne.jsx +++ b/client/src/pages/Update/FormOne/FormOne.jsx @@ -32,34 +32,18 @@ const FormOne = () => { } }, [userData.gender]) + const description = ['SELECT_YOUR_RESIDENCY_BY_SELECTING_THE_APPROPRIATE_CHECKBOX', 'ENTER_YOUR_FULL_NAME_WITHOUT_ANY_TITLE_OR_SALUTATION', 'SELECT_YOUR_GENDER_BY_CLICKING_ON_THE_APPROPRIATE_CARD', 'SELECT_YOUR_DATE_OF_BIRTH_FROM_THE_PROVIDED_CALENDER'] + return ( <> <Header subheading={t('UPDATE')} /> <PopUpModal - title="Fill your information" + title="FILL_YOUR_INFORMATION" image={`${process.env.PUBLIC_URL}/assets/images/id.svg`} description={ <> <ul> - <li className="list__item"> - Select your residency by selecting the appropriate checkbox - </li> - <li className="list__item"> - Enter your full name without any title or salutation - </li> - <li className="list__item"> - Select your gender by clicking on the appropriate card - </li> - <li className="list__item"> - Select your date of birth from the provided calender - </li> - <li className="list__item"> - Enter your 10 digit mobile number without any prefix or country - code - </li> - <li className="list__item"> - Enter your email address in proper format - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } diff --git a/client/src/pages/Update/Otp/Otp.jsx b/client/src/pages/Update/Otp/Otp.jsx index 75a4d73..ca792fa 100644 --- a/client/src/pages/Update/Otp/Otp.jsx +++ b/client/src/pages/Update/Otp/Otp.jsx @@ -10,6 +10,7 @@ import { getUserByAadhaar, sendOTP } from '../../../services/apiservice' import SubmitButton from '../../../components/SubmitButton/SubmitButton' import { toast, ToastContainer } from 'react-toastify' import PopUpModal from '../../../components/Modal/Modal' +import Spinner from '../../../components/Spinner/Spinner' import styles from './Otp.module.css' @@ -63,7 +64,7 @@ const Otp = () => { } if (isLoading) { - return <div>{t('loading')}</div> + return <Spinner heading='UPDATE'/> } if (isError) { @@ -73,6 +74,9 @@ const Otp = () => { if (data) { setOriUserData(data?.data) } + + const description = ['CLICK_ON_SEND_OTP', 'YOU_WILL_RECIEVE_AN_OTP_ON_YOUR_MOBILE_NUMBER', 'YOU_CAN_RESEND_THE_OTP_AFTER_30_SECONDS_IF_YOU_HAVENT_RECEIVED_IT_YET', 'CLICK_ON_VERIFY_OTP_TO_VERIFY_YOUR_MOBILE_NUMBER'] + return ( <> <ToastContainer @@ -82,22 +86,12 @@ const Otp = () => { /> <Header subheading={`${t('UPDATE')}`} /> <PopUpModal - title="Verify your mobile number" + title="VERIFY_YOUR_MOBILE_NUMBER" image={`${process.env.PUBLIC_URL}/assets/images/otp.svg`} description={ <> <ul> - <li className="list__item">Click on "SEND OTP"</li> - <li className="list__item"> - You will recieve an OTP on your entered mobile number - </li> - <li className="list__item"> - You can "RESEND" the OTP after 30 seconds, if you - haven't received it yet. - </li> - <li className="list__item"> - Click on "VERIFY OTP" to verify your mobile number - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } diff --git a/client/src/pages/Update/PhotoCapture/PhotoCapture.jsx b/client/src/pages/Update/PhotoCapture/PhotoCapture.jsx index 25f8572..4fd4117 100644 --- a/client/src/pages/Update/PhotoCapture/PhotoCapture.jsx +++ b/client/src/pages/Update/PhotoCapture/PhotoCapture.jsx @@ -30,25 +30,18 @@ const PhotoCapture = () => { } } + const description = ['ENSURE_THAT_YOUR_PHOTO_IS_CLEAR_AND_IN_FOCUS', 'ALSO_ENSURE_THAT_YOU_ARE_IN_THE_CENTER_OF_YOUR_PHOTO', 'YOU_WONT_BE_ABLE_TO_PROCEED_UNTIL_YOU_HAVE_CAPTURED_A_CLEAR_AND_CENTERED_PHOTO'] + return ( <> <Header subheading={t('UPDATE')} /> <PopUpModal - title="Update your photo" + title="CAPTURE_YOUR_PHOTO" image={`${process.env.PUBLIC_URL}/assets/images/photo.svg`} description={ <> <ul> - <li className="list__item"> - Ensure that your photo is clear and in focus - </li> - <li className="list__item"> - Also, ensure that you are in the center of your photo - </li> - <li className="list__item"> - You won't be able to proceed until you have captured a - clear and centered photo - </li> + {description.map((item) => (<li className="list__item" key='id'>{t(item)}</li>))} </ul> </> } |