summaryrefslogtreecommitdiff
path: root/client/src/pages/Enrollment
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/pages/Enrollment')
-rw-r--r--client/src/pages/Enrollment/Agreement/Agreement.jsx12
-rw-r--r--client/src/pages/Enrollment/Enrollment.jsx34
-rw-r--r--client/src/pages/Enrollment/FormOne/FormOne.jsx4
3 files changed, 34 insertions, 16 deletions
diff --git a/client/src/pages/Enrollment/Agreement/Agreement.jsx b/client/src/pages/Enrollment/Agreement/Agreement.jsx
index 9dedb56..13b46ba 100644
--- a/client/src/pages/Enrollment/Agreement/Agreement.jsx
+++ b/client/src/pages/Enrollment/Agreement/Agreement.jsx
@@ -60,7 +60,17 @@ const Agreement = ({ unverified, setUnverified }) => {
description={
<>
<ul>
- <li className="list__item">INSTRUCTIONS TO BE ADDED</li>
+ <li className="list__item">Click on &quot;SEND OTP&quot;</li>
+ <li className="list__item">
+ You will recieve an OTP on your entered mobile number
+ </li>
+ <li className="list__item">
+ You can &quot;RESEND&quot; the OTP after 30 seconds, if you
+ haven&apos;t received it yet.
+ </li>
+ <li className="list__item">
+ Click on &quot;VERIFY OTP&quot; to verify your mobile number
+ </li>
</ul>
</>
}
diff --git a/client/src/pages/Enrollment/Enrollment.jsx b/client/src/pages/Enrollment/Enrollment.jsx
index 53d64d5..35a599f 100644
--- a/client/src/pages/Enrollment/Enrollment.jsx
+++ b/client/src/pages/Enrollment/Enrollment.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable space-before-function-paren */
import React, { useState, useEffect } from 'react'
import Address from './Address/Address'
import Agreement from './Agreement/Agreement'
@@ -37,7 +38,7 @@ const Enrollment = () => {
const [model, setModel] = useState()
- async function loadModel () {
+ async function loadModel() {
try {
const model = await cocoSsd.load()
setModel(model)
@@ -55,7 +56,7 @@ const Enrollment = () => {
}, [])
let predictions = []
- async function predictionFunction () {
+ async function predictionFunction() {
predictions = await model.detect(document.getElementById('img'))
if (predictions.length > 0) {
console.log(predictions)
@@ -140,21 +141,26 @@ const Enrollment = () => {
}
} else if (page === 3) {
predictionFunction()
- if (predictions.length === 0) {
- toast.warning(t('PLEASE_WAIT'), {
+ if (predictions.length === 0) {
+ toast.warning(t('PLEASE_WAIT'), {
timeout: 1000
- })
- }
+ })
+ }
setTimeout(() => {
if (predictions.length > 0) {
- if (!userData.photo) {
- toast.error(t('PLEASE_CAPTURE_PHOTOGRAPH'))
- } else if (predictions[0].class === 'person' && predictions[0].score > 0.5) {
- setPage(page + 1)
- } else {
- toast.error(t('PLEASE_CAPTURE_CLEAR_PHOTOGRAPH'))
- }
- }
+ if (!userData.photo) {
+ toast.error(t('PLEASE_CAPTURE_PHOTOGRAPH'))
+ } else if (
+ predictions[0].class === 'person' &&
+ predictions[0].score > 0.8
+ ) {
+ setPage(page + 1)
+ } else {
+ toast.error(t('PLEASE_CAPTURE_CLEAR_PHOTOGRAPH'))
+ }
+ } else {
+ toast.error(t('PLEASE_CAPTURE_CLEAR_PHOTOGRAPH'))
+ }
}, 1000)
} else if (page === 4) {
if (!userData.documents.POI) {
diff --git a/client/src/pages/Enrollment/FormOne/FormOne.jsx b/client/src/pages/Enrollment/FormOne/FormOne.jsx
index 3fd5a21..fb37457 100644
--- a/client/src/pages/Enrollment/FormOne/FormOne.jsx
+++ b/client/src/pages/Enrollment/FormOne/FormOne.jsx
@@ -88,7 +88,9 @@ const FormOne = () => {
}}
required
/>
- <label htmlFor="indian">{t('NON_RESIDENTIAL_INDIAN')}</label>
+ <label htmlFor="non-resident-indian">
+ {t('NON_RESIDENTIAL_INDIAN')}
+ </label>
</span>
</div>