-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: QR code scanner #8196
feat: QR code scanner #8196
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Storybook deployed: https://feat-ocrvs-7978-qr-reader.opencrvs.pages.dev |
const StyledButton = styled(SecondaryButton)` | ||
width: 100%; | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Button
component instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thanks. will do
const Scanner = (props: ScannerProps) => { | ||
const scanner = useRef<QRScanner>() | ||
const videoElement = useRef<HTMLVideoElement>(null) | ||
const [qrOn, setQrOn] = useState(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I read this correctly, qrOn can never be false. When the camera cannot be used, we need to consider the error cases a bit. Let's create a new ticket on that and solve it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks @naftis that is true and because of the fact that qrOn
is never false,
if (!qrOn) alert('Could not scan') |
this line becomes irrelevant. We might need to determine how to handle that case as the current way is showing an alert which was an interim change and not sure if it should stay like this
Issue created: #8330
we dont know the body but the params are parsed as string
E2E tests are passing for current HEAD: |
Reason for this feature
To support countries which implemented identity systems to obtain identifiers for its residents. A common use case is that there is a QR code associated with the resident's identity card provided by the identity system. The QR code holds the person information and can be used to pre-fill event form. We need to support this use case.
What this feature does
This feature introduces QR code scanning ability to the application via a UI component called
<IDReader />
which can be used in form with typeID_READER
allowing the form to be pre-populated based on form configuration.Bundle size effects
Before (develop):
After (feature branch merged with develop)
Merging this ticket closes #7978, #7979