From 6c867e639e565262bbf71342f953456a7d0b7f7a Mon Sep 17 00:00:00 2001 From: Blaster4385 Date: Fri, 19 Aug 2022 22:53:02 +0530 Subject: Refine UI --- client/src/components/Card/CardAgreement.jsx | 2 +- .../src/components/Card/CardAgreement.module.css | 2 +- .../src/pages/Enrollment/Agreement/Agreement.jsx | 1 + .../Enrollment/DocumentScanner/DocumentScanner.jsx | 175 ++++++++++----------- .../DocumentScanner/DocumentScanner.module.css | 40 +++++ 5 files changed, 126 insertions(+), 94 deletions(-) (limited to 'client/src') diff --git a/client/src/components/Card/CardAgreement.jsx b/client/src/components/Card/CardAgreement.jsx index da35c91..77bb1a0 100644 --- a/client/src/components/Card/CardAgreement.jsx +++ b/client/src/components/Card/CardAgreement.jsx @@ -10,7 +10,7 @@ const CardAgreement = ({ title, image }) => { <>
- + {t('I_HEREBY_CONFIRM_THE_IDENTITY_AND_ADDRESS')}
diff --git a/client/src/components/Card/CardAgreement.module.css b/client/src/components/Card/CardAgreement.module.css index c9bdae8..c6b76cb 100644 --- a/client/src/components/Card/CardAgreement.module.css +++ b/client/src/components/Card/CardAgreement.module.css @@ -27,5 +27,5 @@ } .card__image { - padding-bottom: 32px; + height: 80%; } diff --git a/client/src/pages/Enrollment/Agreement/Agreement.jsx b/client/src/pages/Enrollment/Agreement/Agreement.jsx index cf74d46..d3a5b90 100644 --- a/client/src/pages/Enrollment/Agreement/Agreement.jsx +++ b/client/src/pages/Enrollment/Agreement/Agreement.jsx @@ -68,6 +68,7 @@ const Agreement = ({ unverified, setUnverified }) => { type="submit" variant="contained" disabled={disabled} + sx={{ marginTop: '1rem' }} onClick={() => { mutate() setDisabled(true) diff --git a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx index 20ea7d2..86f53f4 100644 --- a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx +++ b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx @@ -3,15 +3,7 @@ import React, { useState } from 'react' import Webcam from 'react-webcam' import Header from '../../../components/Header/Header' import styles from './DocumentScanner.module.css' -import { - Button, - Grid, - Typography, - StepLabel, - Step, - Stepper, - Box -} from '@mui/material' +import { Button, Typography, StepLabel, Step, Stepper } from '@mui/material' import SubmitButton from '../../../components/SubmitButton/SubmitButton' import { useTranslation } from 'react-i18next' import { userContext } from '../../../context/User' @@ -45,15 +37,15 @@ const DocumentScanner = () => { DOB: doccu.DOB }) }) - + console.log(activeStep) const handleNext = () => { if (activeStep === steps.length - 1) { setUserData({ ...userData, documents: documents }) } if ( - !userData.documents.POI || - !userData.documents.POA || - !userData.documents.DOB + (!documents.POI && activeStep === 0) || + (!documents.POA && activeStep === 1) || + (!documents.DOB && activeStep === 2) ) { toast.error(t('SCAN_YOUR_DOCUMENT')) } else { @@ -68,67 +60,85 @@ const DocumentScanner = () => { const WebcamComponent = ({ doc }) => { return ( <> -
- {documents[doc] === '' ? ( - + +
+ {documents[doc] === '' ? ( + + ) : ( + + )} +
+ +
+
+ +
- - - - - - - -

- +
{t('KINDLY_CLICK_THE_PICTURE_OF_YOUR_DOCUMENTS')} - +
) @@ -139,8 +149,8 @@ const DocumentScanner = () => {
- - +
+ {steps.map((label, index) => { const stepProps = {} const labelProps = {} @@ -157,14 +167,9 @@ const DocumentScanner = () => { })} {activeStep === steps.length ? ( - - - {t('ALL_STEPS_COMPLETED')} - - - - - + + {t('ALL_STEPS_COMPLETED')} + ) : ( {activeStep === 0 ? ( @@ -174,23 +179,9 @@ const DocumentScanner = () => { ) : ( activeStep === 2 && )} - - - - - )} - +
) diff --git a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.module.css b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.module.css index 58baaa8..11cd176 100644 --- a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.module.css +++ b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.module.css @@ -1,6 +1,7 @@ .card__container { display: flex; justify-content: center; + align-items: center; margin: 20px; } @@ -8,3 +9,42 @@ display: flex; justify-content: center; } + +.button__container { + display: flex; + justify-content: space-evenly; + align-items: center; +} + +.button { + background: transparent; + border: none; +} + +.image { + height: 50px; + width: 50px; +} + +.image:hover { + cursor: pointer; + transform: scale(1.1); +} + +.image:active { + transform: scale(0.98); +} + +.box { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + width: 100%; + height: 100%; +} + +.container { + display: flex; + align-items: center; +} \ No newline at end of file -- cgit