Skip to content

Commit

Permalink
resolved dependency issues with react-qr-reader
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Dec 2, 2024
1 parent e75c2c6 commit 9c685d0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 70 deletions.
1 change: 0 additions & 1 deletion apps/web-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"react-icons": "^5.0.1",
"react-konva": "^18.2.10",
"react-markdown": "^9.0.1",
"react-qr-reader": "3.0.0-beta-1",
"react-query": "^3.39.3",
"react-remove-scroll": "^2.6.0",
"react-simplemde-editor": "^5.2.0",
Expand Down
23 changes: 14 additions & 9 deletions apps/web-admin/src/components/Scanner.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { QrReader } from 'react-qr-reader';
import { Box } from '@chakra-ui/react';
import { useZxing } from 'react-zxing';

const Scanner = ({ result, setResult }) => {
const handleScan = (result) => {
Expand All @@ -12,15 +12,20 @@ const Scanner = ({ result, setResult }) => {
const handleError = (err) => {
console.error(err);
};

const { ref } = useZxing({
onDecodeResult(result) {
setResult(result.getText());
},
});
return (
<QrReader
height="100%"
width="100%"
constraints={{ facingMode: 'environment' }}
onResult={handleScan}
onError={handleError}
/>
// <QrReader
// height="100%"
// width="100%"
// constraints={{ facingMode: 'environment' }}
// onResult={handleScan}
// onError={handleError}
// />
<video ref={ref} style={{ height: '100%', width: '100%' }} onError={handleError} />
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default function CheckOutParticipant() {
</FormControl>

<Button type="submit" width="100%" my="4" isLoading={loading} loadingText="Please Wait">
Check In
Check Out
</Button>
</form>
</DashboardLayout>
Expand Down
59 changes: 0 additions & 59 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c685d0

Please sign in to comment.