Skip to content

Commit

Permalink
Add loader while loading the uploaded qr
Browse files Browse the repository at this point in the history
Signed-off-by: Shiva <[email protected]>
  • Loading branch information
shiva-beehyv committed Apr 16, 2024
1 parent ce6bbb7 commit 0179fcc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function VcDisplayCard({vc, setActiveStep}: {vc: any, setActiveStep: SetActiveSt
<StyledButton style={{margin: "24px auto"}} onClick={() => {
setActiveStep(VerificationSteps.ScanQrCodePrompt)
}}>
Scan Another QR Code
Verify Another QR Code
</StyledButton>
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const ScanQrCode = ({setScanResult}: {
</Box>
</Grid>
<Grid item xs={12} order={scanStatus === "Failed" ? 2 : 3}>
<UploadQrCode setScanResult={checkScanResult} setScanStatus={setScanStatus} displayMessage="Upload QR Code"/>
<UploadQrCode
setScanResult={checkScanResult}
setScanStatus={setScanStatus}
displayMessage={scanStatus === "Failed" ? "Upload Another QR Code" : "Upload QR Code"}/>
</Grid>
<Grid item xs={12} order={scanStatus === "Failed" ? 3 : 2}>
<StyledButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const UploadQrCode = ({setScanResult, displayMessage, setScanStatus}:
setAlertInfo({...AlertMessages.unsupportedFileSize, open: true})
return;
}
setActiveStep(VerificationSteps.Verifying);
scanFilesForQr(file)
.then(scanResult => {
setScanStatus(!!scanResult.data ? "Success" : "Failed")
Expand Down
3 changes: 3 additions & 0 deletions inji-verify/src/components/Home/VerificationSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const DisplayActiveStep = () => {
// show error message in snackbar
}
setQrData(result.data || "");
if (!result.data) {
setActiveStep(VerificationSteps.ScanQrCodePrompt);
}
}

switch (activeStep) {
Expand Down

0 comments on commit 0179fcc

Please sign in to comment.