From 4cb3e291e1eb9b1ee917399cb7a9e4a28e93eee9 Mon Sep 17 00:00:00 2001 From: Shiva Date: Tue, 2 Apr 2024 11:13:45 +0530 Subject: [PATCH 01/10] Adding responsiveness Signed-off-by: Shiva --- src/assets/qr.svg | 14 ++++++ .../InjiStepper.tsx | 47 ------------------- .../InjiStepper/DesktopStepper.tsx | 25 ++++++++++ .../InjiStepper/MobileStepper.tsx | 9 ++++ .../InjiStepper/index.tsx | 34 ++++++++++++++ .../VerificationProgressTracker/QrScanner.tsx | 4 +- .../Home/VerificationSection/ScanQrCode.tsx | 27 +++++++++-- .../commons/StyledButton.tsx | 11 +++-- 8 files changed, 117 insertions(+), 54 deletions(-) create mode 100644 src/assets/qr.svg delete mode 100644 src/components/Home/VerificationProgressTracker/InjiStepper.tsx create mode 100644 src/components/Home/VerificationProgressTracker/InjiStepper/DesktopStepper.tsx create mode 100644 src/components/Home/VerificationProgressTracker/InjiStepper/MobileStepper.tsx create mode 100644 src/components/Home/VerificationProgressTracker/InjiStepper/index.tsx diff --git a/src/assets/qr.svg b/src/assets/qr.svg new file mode 100644 index 00000000..8f943b9d --- /dev/null +++ b/src/assets/qr.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/Home/VerificationProgressTracker/InjiStepper.tsx b/src/components/Home/VerificationProgressTracker/InjiStepper.tsx deleted file mode 100644 index 448aea86..00000000 --- a/src/components/Home/VerificationProgressTracker/InjiStepper.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import {Box, Step, StepContent, StepLabel, Stepper, Typography} from "@mui/material"; - -const steps = [ - { - label: 'Scan QR Code', - description: 'Tap the button and display the QR code shown on your digital certificate / card', - }, - { - label: 'Activate your device’s camera', - description: - 'A notification will prompt to activate your device’s camera', - }, - { - label: 'Verification', - description: 'Validating and verification of your digital document / card' - }, - { - label: 'Result', - description: 'Credibility result of your digital document / card' - } -]; - -const InjiStepper = ({activeStep}: any) => { - return ( - - - {steps.map((step, index) => ( - - - - {step.label} - - - - - ))} - - - ); -} - -export default InjiStepper; diff --git a/src/components/Home/VerificationProgressTracker/InjiStepper/DesktopStepper.tsx b/src/components/Home/VerificationProgressTracker/InjiStepper/DesktopStepper.tsx new file mode 100644 index 00000000..e5c7a0dc --- /dev/null +++ b/src/components/Home/VerificationProgressTracker/InjiStepper/DesktopStepper.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import {Box, Step, StepContent, StepLabel, Stepper, Typography} from "@mui/material"; + +function DesktopStepper({steps, activeStep}: {steps: {label: string, description: string}[], activeStep: number}) { + return ( + + {steps.map((step, index) => ( + + + + {step.label} + + + + + ))} + + ); +} + +export default DesktopStepper; \ No newline at end of file diff --git a/src/components/Home/VerificationProgressTracker/InjiStepper/MobileStepper.tsx b/src/components/Home/VerificationProgressTracker/InjiStepper/MobileStepper.tsx new file mode 100644 index 00000000..b578226c --- /dev/null +++ b/src/components/Home/VerificationProgressTracker/InjiStepper/MobileStepper.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +function MobileStepper({steps, activeStep}: {steps: {label: string, description: string}[], activeStep: number}) { + return ( +
+ ); +} + +export default MobileStepper; diff --git a/src/components/Home/VerificationProgressTracker/InjiStepper/index.tsx b/src/components/Home/VerificationProgressTracker/InjiStepper/index.tsx new file mode 100644 index 00000000..43052356 --- /dev/null +++ b/src/components/Home/VerificationProgressTracker/InjiStepper/index.tsx @@ -0,0 +1,34 @@ +import React from 'react'; +import {Box, Step, StepContent, StepLabel, Stepper, Typography, useMediaQuery} from "@mui/material"; +import DesktopStepper from "./DesktopStepper"; + +const steps = [ + { + label: 'Scan QR Code', + description: 'Tap the button and display the QR code shown on your digital certificate / card', + }, + { + label: 'Activate your device’s camera', + description: + 'A notification will prompt to activate your device’s camera', + }, + { + label: 'Verification', + description: 'Validating and verification of your digital document / card' + }, + { + label: 'Result', + description: 'Credibility result of your digital document / card' + } +]; + +const InjiStepper = ({activeStep}: {activeStep: number}) => { + + return ( + + + + ); +} + +export default InjiStepper; diff --git a/src/components/Home/VerificationProgressTracker/QrScanner.tsx b/src/components/Home/VerificationProgressTracker/QrScanner.tsx index 527e00e0..3db11855 100644 --- a/src/components/Home/VerificationProgressTracker/QrScanner.tsx +++ b/src/components/Home/VerificationProgressTracker/QrScanner.tsx @@ -6,6 +6,7 @@ function QrScanner({setVerifying, setActiveStep, setQrData}: any) { const [dataRead, setDataRead] = useState(false) const isDataRead = useCallback(() => dataRead, [dataRead]); + return ( diff --git a/src/components/Home/VerificationSection/ScanQrCode.tsx b/src/components/Home/VerificationSection/ScanQrCode.tsx index 5c92d565..0360be94 100644 --- a/src/components/Home/VerificationSection/ScanQrCode.tsx +++ b/src/components/Home/VerificationSection/ScanQrCode.tsx @@ -1,8 +1,10 @@ import React from 'react'; import {Box, Button, Grid, Typography} from "@mui/material"; -import scanQr from "../../../assets/scanner-ouline.svg"; import StyledButton from "./commons/StyledButton"; +import scanQr from "../../../assets/scanner-ouline.svg"; +import qrImage from "../../../assets/qr.svg"; + const ScanQrCode = ({setActiveStep}: { setActiveStep: (activeStep: number) => void }) => { @@ -13,10 +15,29 @@ const ScanQrCode = ({setActiveStep}: { marginBottom: "44px" }}>Scan QR Code - + +
+ +
+
- setActiveStep(1)}> + setActiveStep(1)}> Scan the QR Code diff --git a/src/components/Home/VerificationSection/commons/StyledButton.tsx b/src/components/Home/VerificationSection/commons/StyledButton.tsx index 45cdb8b7..f2634d6b 100644 --- a/src/components/Home/VerificationSection/commons/StyledButton.tsx +++ b/src/components/Home/VerificationSection/commons/StyledButton.tsx @@ -1,16 +1,21 @@ import React from 'react'; -import {Button, ButtonProps, Typography} from "@mui/material"; +import {Button, ButtonProps} from "@mui/material"; -function StyledButton(props: ButtonProps) { +type StyledButtonProps = ButtonProps & { + fill?: boolean +} + +function StyledButton(props: StyledButtonProps) { return (