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 ( - + // +