From 4fbce4ec31c82073eb75aea1bd96a32dcc144be7 Mon Sep 17 00:00:00 2001 From: Srinath Date: Fri, 20 Feb 2026 15:32:00 +0530 Subject: [PATCH] Added Qr scann on mobile Funtionalites --- .../UtillComponents/BSNavBarComboSearch.jsx | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarComboSearch.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarComboSearch.jsx index 33a4909..507f21b 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarComboSearch.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarComboSearch.jsx @@ -32,6 +32,7 @@ import BarcodeScanner from './BarcodeScanner'; import { isMobile } from 'react-device-detect'; import { BiBarcodeReader } from 'react-icons/bi'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; +import BarCodeScan from '../../../../Services/BarCodeScan.jsx'; const BSNavBarComboSearch = (props) => { @@ -1197,28 +1198,28 @@ const BSNavBarComboSearch = (props) => { : []; // }); }; - const stopScannerFromParent = () => { - if (scannerRef.current) { - scannerRef.current.stopScanner(); // Call stopScanner from the child component - } - }; + // const stopScannerFromParent = () => { + // if (scannerRef.current) { + // scannerRef.current.stopScanner(); // Call stopScanner from the child component + // } + // }; - const handleQrcode = () => { - setOpenScanner((prev) => !prev); - if (!openScanner && scannerRef.current) { - scannerRef.current.reinitializeCamera(); // Call the function to reinitialize the camera - } - }; + // const handleQrcode = () => { + // setOpenScanner((prev) => !prev); + // if (!openScanner && scannerRef.current) { + // scannerRef.current.reinitializeCamera(); // Call the function to reinitialize the camera + // } + // }; - const handleQrData = (decodedText, err) => { - onChangeprodFunction(decodedText); - setOpenScanner(false); // Close the modal after scanning - stopScannerFromParent(); - if (err && err?.error) { - setMessageData(err?.error); - setMessageType('error'); - } - }; + // const handleQrData = (decodedText, err) => { + // onChangeprodFunction(decodedText); + // setOpenScanner(false); // Close the modal after scanning + // stopScannerFromParent(); + // if (err && err?.error) { + // setMessageData(err?.error); + // setMessageType('error'); + // } + // }; return (
{ />
{isMobile && screenWidth <= 768 ? ( - handleQrcode()} - /> + // handleQrcode()} + // /> + { + onChangeprodFunction(value); + }} /> ) : ( )} @@ -1395,7 +1400,7 @@ const BSNavBarComboSearch = (props) => { )} - {isMobile && screenWidth <= 768 && ( + {/* {isMobile && screenWidth <= 768 && ( { /> )} - )} + )} */} ); };