-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from shiva-beehyv/add-data-test-ids-and-respons…
…iveness Add support for scanning qr from images/pdfs
- Loading branch information
Showing
29 changed files
with
404 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# inji-verify | ||
Repository host the source code, documentation, and other related files for the Inji Verify project. | ||
|
||
# Project Setup - Development | ||
|
||
Prerequisites: | ||
* Node 18 - Can be installed using [nvm](https://github.com/nvm-sh/nvm). Run following command to install node | ||
|
||
```curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash``` | ||
|
||
```nvm install 18``` | ||
|
||
Run following commands to start the application | ||
|
||
```npm install``` | ||
|
||
```npm start``` | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 0 additions & 47 deletions
47
inji-verify/src/components/Home/VerificationProgressTracker/InjiStepper.tsx
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
inji-verify/src/components/Home/VerificationProgressTracker/InjiStepper/DesktopStepper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import {Box, Step, StepContent, StepLabel, Stepper, Typography} from "@mui/material"; | ||
import {InjiStepperStep} from "../../../../types/data-types"; | ||
|
||
function DesktopStepper({steps, activeStep}: {steps: InjiStepperStep[], activeStep: number}) { | ||
return ( | ||
<Stepper activeStep={activeStep} orientation="vertical"> | ||
{steps.map((step, index) => ( | ||
<Step key={step.label} style={{alignContent: 'start'}}> | ||
<StepLabel> | ||
<Typography style={{font: 'normal normal bold 16px/20px Inter'}}> | ||
{step.label} | ||
</Typography> | ||
</StepLabel> | ||
<StepContent | ||
TransitionProps={{appear: true, unmountOnExit: false}} | ||
hidden={false} style={{borderColor: '#FF7F00', display: 'block'}}> | ||
<Typography>{step.description}</Typography> | ||
</StepContent> | ||
</Step> | ||
))} | ||
</Stepper> | ||
); | ||
} | ||
|
||
export default DesktopStepper; |
21 changes: 21 additions & 0 deletions
21
inji-verify/src/components/Home/VerificationProgressTracker/InjiStepper/MobileStepper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import {Step, StepLabel, Stepper, Typography} from "@mui/material"; | ||
import {InjiStepperStep} from "../../../../types/data-types"; | ||
|
||
function MobileStepper({steps, activeStep}: {steps: InjiStepperStep[], activeStep: number}) { | ||
return ( | ||
<Stepper style={{maxHeight: '350px'}} activeStep={activeStep} orientation="horizontal" alternativeLabel> | ||
{steps.map((step, index) => ( | ||
<Step key={step.label} style={{alignContent: 'start'}}> | ||
<StepLabel> | ||
<Typography style={{font: 'normal normal bold 16px/20px Inter'}}> | ||
{step.label} | ||
</Typography> | ||
</StepLabel> | ||
</Step> | ||
))} | ||
</Stepper> | ||
); | ||
} | ||
|
||
export default MobileStepper; |
41 changes: 41 additions & 0 deletions
41
inji-verify/src/components/Home/VerificationProgressTracker/InjiStepper/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import {Box, Step, StepContent, StepLabel, Stepper, Typography, useMediaQuery} from "@mui/material"; | ||
import DesktopStepper from "./DesktopStepper"; | ||
import MobileStepper from "./MobileStepper"; | ||
import {InjiStepperStep} from "../../../../types/data-types"; | ||
|
||
const steps: InjiStepperStep[] = [ | ||
{ | ||
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}) => { | ||
const isDesktop = useMediaQuery('@media (min-width:768px)'); | ||
|
||
return ( | ||
<Box style={{marginTop: '30px'}}> | ||
{ | ||
isDesktop | ||
? (<DesktopStepper steps={steps} activeStep={activeStep}/>) | ||
: (<MobileStepper steps={steps} activeStep={activeStep}/>) | ||
} | ||
</Box> | ||
); | ||
} | ||
|
||
export default InjiStepper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
inji-verify/src/components/Home/VerificationSection/ImportFromFile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {scanFilesForQr} from "../../../utils/qr-utils"; | ||
import {QrScanResult} from "../../../types/data-types"; | ||
import {SetScanResultFunction} from "../../../types/function-types"; | ||
import StyledButton from "./commons/StyledButton"; | ||
|
||
export const ImportFromFile = ({setScanResult}: {setScanResult: SetScanResultFunction}) => { | ||
return ( | ||
<div style={{margin: "12px auto", display: "grid", placeContent: "center"}}> | ||
<StyledButton> | ||
<label htmlFor={"upload-qr"}> | ||
Upload your certificate</label> | ||
</StyledButton> | ||
<br/> | ||
<input | ||
type="file" | ||
id="upload-qr" | ||
name="upload-qr" | ||
accept=".png, .jpeg, .jpg, .pdf" | ||
style={{ | ||
margin: "8px auto", | ||
display: "none" | ||
}} | ||
onChange={e => { | ||
const file = e?.target?.files && e?.target?.files[0]; | ||
if (!file) return; | ||
scanFilesForQr(file) | ||
.then(scanResult => { | ||
setScanResult(scanResult); | ||
}); | ||
}} | ||
/> | ||
</div>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.