From 9c685d09b0a76fb538dbc102b33e57ba3086e7be Mon Sep 17 00:00:00 2001 From: Subramani E Date: Mon, 2 Dec 2024 13:47:35 +0530 Subject: [PATCH] resolved dependency issues with react-qr-reader --- apps/web-admin/package.json | 1 - apps/web-admin/src/components/Scanner.jsx | 23 +++++--- .../participants/check-in/out/index.jsx | 2 +- pnpm-lock.yaml | 59 ------------------- 4 files changed, 15 insertions(+), 70 deletions(-) diff --git a/apps/web-admin/package.json b/apps/web-admin/package.json index 85c078c7..508829e0 100644 --- a/apps/web-admin/package.json +++ b/apps/web-admin/package.json @@ -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", diff --git a/apps/web-admin/src/components/Scanner.jsx b/apps/web-admin/src/components/Scanner.jsx index 499032c9..18cd57aa 100644 --- a/apps/web-admin/src/components/Scanner.jsx +++ b/apps/web-admin/src/components/Scanner.jsx @@ -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) => { @@ -12,15 +12,20 @@ const Scanner = ({ result, setResult }) => { const handleError = (err) => { console.error(err); }; - + const { ref } = useZxing({ + onDecodeResult(result) { + setResult(result.getText()); + }, + }); return ( - + // +