diff --git a/apps/web/package.json b/apps/web/package.json index 4aff4af5..44e85e7c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -42,7 +42,7 @@ "@vercel/blob": "^0.10.0", "@vercel/kv": "^2.0.0", "@vercel/postgres": "^0.9.0", - "@yudiel/react-qr-scanner": "^1.1.9", + "@yudiel/react-qr-scanner": "^2.1.0", "autoprefixer": "10.4.19", "axios": "^1.7.2", "class-variance-authority": "^0.7.0", diff --git a/apps/web/src/components/admin/scanner/CheckinScanner.tsx b/apps/web/src/components/admin/scanner/CheckinScanner.tsx index 525ad748..8b82565e 100644 --- a/apps/web/src/components/admin/scanner/CheckinScanner.tsx +++ b/apps/web/src/components/admin/scanner/CheckinScanner.tsx @@ -1,7 +1,7 @@ "use client"; import { useState, useEffect } from "react"; -import { QrScanner } from "@yudiel/react-qr-scanner"; +import { Scanner } from "@yudiel/react-qr-scanner"; import superjson from "superjson"; import { checkInUserToHackathon } from "@/actions/admin/scanner-admin-actions"; import { type QRDataInterface } from "@/lib/utils/shared/qr"; @@ -130,8 +130,8 @@ export default function CheckinScanner({
- { + { const params = new URLSearchParams( searchParams.toString(), ); @@ -139,7 +139,7 @@ export default function CheckinScanner({ setScanLoading(true); const qrParsedData = superjson.parse( - result, + result[0].rawValue, ); params.set("user", qrParsedData.userID); params.set( @@ -153,11 +153,13 @@ export default function CheckinScanner({ ); } }} - onError={(error) => console.log(error?.message)} - containerStyle={{ - width: "100vw", - maxWidth: "500px", - margin: "0", + onError={(error) => console.log(error)} + styles={{ + container: { + width: "100vw", + maxWidth: "500px", + margin: "0", + }, }} />
diff --git a/apps/web/src/components/admin/scanner/PassScanner.tsx b/apps/web/src/components/admin/scanner/PassScanner.tsx index 0c3214d9..f7c1d936 100644 --- a/apps/web/src/components/admin/scanner/PassScanner.tsx +++ b/apps/web/src/components/admin/scanner/PassScanner.tsx @@ -1,7 +1,7 @@ "use client"; import { useState, useEffect } from "react"; -import { QrScanner } from "@yudiel/react-qr-scanner"; +import { Scanner } from "@yudiel/react-qr-scanner"; import superjson from "superjson"; import { createScan } from "@/actions/admin/scanner-admin-actions"; import { useAction } from "next-safe-action/hooks"; @@ -99,8 +99,8 @@ export default function PassScanner({
- { + { const params = new URLSearchParams( searchParams.toString(), ); @@ -108,7 +108,7 @@ export default function PassScanner({ setScanLoading(true); const qrParsedData = superjson.parse( - result, + result[0].rawValue, ); params.set("user", qrParsedData.userID); params.set( @@ -122,11 +122,13 @@ export default function PassScanner({ ); } }} - onError={(error) => console.log(error?.message)} - containerStyle={{ - width: "100vw", - maxWidth: "500px", - margin: "0", + onError={(error) => console.log(error)} + styles={{ + container: { + width: "100vw", + maxWidth: "500px", + margin: "0", + }, }} />
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b740d8f4..a163b7bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -173,8 +173,8 @@ importers: specifier: ^0.9.0 version: 0.9.0 '@yudiel/react-qr-scanner': - specifier: ^1.1.9 - version: 1.2.10(react-dom@18.3.1)(react@18.3.1) + specifier: ^2.1.0 + version: 2.1.0(react-dom@18.3.1)(react@18.3.1) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.39) @@ -6665,6 +6665,14 @@ packages: resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} dev: false + /@types/dom-webcodecs@0.1.11: + resolution: {integrity: sha512-yPEZ3z7EohrmOxbk/QTAa0yonMFkNkjnVXqbGb7D4rMr+F1dGQ8ZUFxXkyLLJuiICPejZ0AZE9Rrk9wUCczx4A==} + dev: false + + /@types/emscripten@1.40.0: + resolution: {integrity: sha512-MD2JJ25S4tnjnhjWyalMS6K6p0h+zQV6+Ylm+aGbiS8tSn/aHLSGNzBgduj6FB4zH0ax2GRMGYi/8G1uOxhXWA==} + dev: false + /@types/eslint-scope@3.7.7: resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} dependencies: @@ -7078,32 +7086,18 @@ packages: resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} dev: false - /@yudiel/react-qr-scanner@1.2.10(react-dom@18.3.1)(react@18.3.1): - resolution: {integrity: sha512-I94AyrEu/2oZxXT6TEOK9+K2IfjqfPmic/GUah7alMIxfgXP9rs9+IZE56JhQr4pZ7Iz2RUC4JFfeaysFYNEIA==} + /@yudiel/react-qr-scanner@2.1.0(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-O3832Qk8YU+vnLO+tsJalfQcXRZ1pOB9l6WrI3OdwpxkQEzukpT48M6Hc2vUUe1rFE6qapQnV3RGRFNM0S7CHw==} peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 + react: ^17 || ^18 || ^19 + react-dom: ^17 || ^18 || ^19 dependencies: - '@zxing/library': 0.20.0 + barcode-detector: 2.3.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + webrtc-adapter: 9.0.1 dev: false - /@zxing/library@0.20.0: - resolution: {integrity: sha512-6Ev6rcqVjMakZFIDvbUf0dtpPGeZMTfyxYg4HkVWioWeN7cRcnUWT3bU6sdohc82O1nPXcjq6WiGfXX2Pnit6A==} - engines: {node: '>= 10.4.0'} - dependencies: - ts-custom-error: 3.3.1 - optionalDependencies: - '@zxing/text-encoding': 0.9.0 - dev: false - - /@zxing/text-encoding@0.9.0: - resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} - requiresBuild: true - dev: false - optional: true - /abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} deprecated: Use your platform's native atob() and btoa() methods instead @@ -7363,6 +7357,13 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + /barcode-detector@2.3.1: + resolution: {integrity: sha512-D9KEtrquS1tmBZduxBZl8qublIKnRrFqD8TAHDYcLCyrHQBo+vitIxmjMJ61LvXjXyAMalOlO7q0Oh/9Rl2PbQ==} + dependencies: + '@types/dom-webcodecs': 0.1.11 + zxing-wasm: 1.3.4 + dev: false + /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -11396,6 +11397,10 @@ packages: ajv-keywords: 3.5.2(ajv@6.12.6) dev: false + /sdp@3.2.0: + resolution: {integrity: sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==} + dev: false + /selderee@0.11.0: resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} dependencies: @@ -12008,11 +12013,6 @@ packages: punycode: 2.3.1 dev: false - /ts-custom-error@3.3.1: - resolution: {integrity: sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==} - engines: {node: '>=14.0.0'} - dev: false - /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: false @@ -12477,6 +12477,13 @@ packages: - uglify-js dev: false + /webrtc-adapter@9.0.1: + resolution: {integrity: sha512-1AQO+d4ElfVSXyzNVTOewgGT/tAomwwztX/6e3totvyyzXPvXIIuUUjAmyZGbKBKbZOXauuJooZm3g6IuFuiNQ==} + engines: {node: '>=6.0.0', npm: '>=3.10.0'} + dependencies: + sdp: 3.2.0 + dev: false + /whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} engines: {node: '>=12'} @@ -12637,6 +12644,12 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false + /zxing-wasm@1.3.4: + resolution: {integrity: sha512-9l0QymyATF19FmI92QHe7Dayb+BUN7P7zFAt5iDgTnUf0dFWokz6GVA/W9EepjW5q8s3e89fIE/7uxpX27yqEQ==} + dependencies: + '@types/emscripten': 1.40.0 + dev: false + settings: autoInstallPeers: true excludeLinksFromLockfile: false