From 189065980f092f7da1e23901e98850f7042cee76 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 24 Feb 2026 17:19:56 +0530 Subject: [PATCH] Design Updated and table issue fixing --- src/App.jsx | 3 +- src/Components/Skeleton/CardSkeleton.scss | 2 +- .../BSBillingTable3/BSBillingTable3pay.jsx | 13 +- .../Components/BSNavbar/BSNavbar1.jsx | 11 +- .../verfiedProduct/VerfiedProducts.jsx | 47 +- .../verfiedProduct/Verfiedproduct.scss | 15 +- .../FeaturesFunctionalities.jsx | 1 + .../UtillComponents/BSNavBarDragItems.jsx | 6 +- .../UtillComponents/BSNavBarFavItems.jsx | 21 +- .../Template/BSLayout2/BSLayout2.jsx | 592 +++++++++--------- .../Offer/CodeBase/CodeBaseListList.scss | 1 + .../Offer/LoyaltyBased/LoyaltiPointList.scss | 251 ++++---- src/Pages/Offer/Offer/OfferList.scss | 1 + src/Services/BarCodeScan.jsx | 414 ++++++------ .../BSBillingTable4/BSBillingTable4.scss | 108 +--- .../BSBillingTables3/BSBillingTable3.scss | 30 +- .../Components/BSNavbar/BSNavbar1.scss | 40 +- .../BookingFunctionality/SplitPayment.scss | 5 +- .../SplitPaymentPreorder.scss | 8 +- .../OtherConponents/Reprint/BSReprint.scss | 8 +- src/Styles/PrinterSetting/PrinterSetting.scss | 15 +- src/Styles/Product/Product.scss | 3 + .../PurchaseQuotation/PurchaseQuotation.scss | 11 +- src/main.jsx | 6 + 24 files changed, 757 insertions(+), 855 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index b4d9eee..9bc0579 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -32,6 +32,7 @@ const ExtendSubscriptionModal = lazy( const commonSubDir = import.meta.env.ENV_COMMON_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL; import '../ownLib/my-ui-lib.css'; +import CardSkeleton from './Components/Skeleton/CardSkeleton.jsx'; const AppRoutes = () => { const ItemCard = useSelector(GlobalItemCard); @@ -84,7 +85,7 @@ const AppRoutes = () => { ); } return ( - Loading…}> + }> import('../../UtillComponents/PaymentGatewayEmbedded.jsx') ); @@ -3585,9 +3586,9 @@ const BSBillingTable3Pay = () => { ); }; return ( - Suspense Loading...}> + }> <> -
+
{screenwidth <= 768 && (
{
)} - -
diff --git a/src/Pages/BookingScreen/Components/BSNavbar/BSNavbar1.jsx b/src/Pages/BookingScreen/Components/BSNavbar/BSNavbar1.jsx index 095be1d..ea99ec2 100644 --- a/src/Pages/BookingScreen/Components/BSNavbar/BSNavbar1.jsx +++ b/src/Pages/BookingScreen/Components/BSNavbar/BSNavbar1.jsx @@ -684,14 +684,7 @@ const BSNavbar1 = (props) => { )}
-
+
{/* Multiple search */}
@@ -722,7 +715,7 @@ const BSNavbar1 = (props) => { ))} {Comboglobal === true && ( -
+
)} diff --git a/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/VerfiedProducts.jsx b/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/VerfiedProducts.jsx index 6b5a781..54df4fb 100644 --- a/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/VerfiedProducts.jsx +++ b/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/VerfiedProducts.jsx @@ -22,7 +22,6 @@ import { changeOfferAppliedProductsForMembership } from '../../../../../Features import BarCodeScan from '../../../../../Services/BarCodeScan.jsx'; import { isMobile } from 'react-device-detect'; - const VerfiedProducts = ({ drawerOpen = false, setDrawerOpen = () => {} }) => { const dispatch = useDispatch(); const [isOpenModal, setisOpenModal] = useState(false); @@ -73,7 +72,11 @@ const VerfiedProducts = ({ drawerOpen = false, setDrawerOpen = () => {} }) => { const UpdatedData = payload?.data?.[0]?.productDetails; if (UpdatedData?.length > 0) { await dispatch(changeOrderCardDetails(UpdatedData)); - dispatch(changeOfferAppliedProductsForMembership(payload?.data?.[0]?.OrderOfferDetails)) + dispatch( + changeOfferAppliedProductsForMembership( + payload?.data?.[0]?.OrderOfferDetails + ) + ); await dispatch(changeReorderHoldDetails(payload?.data?.[0])); let data = { CustId: payload?.data?.[0]?.CustSuppId, @@ -265,7 +268,7 @@ const VerfiedProducts = ({ drawerOpen = false, setDrawerOpen = () => {} }) => { >
{} }) => { ? 'Fetch Booking' : 'Fetch Products'} - + {!isMobile ? ( + + ) : ( + { + setScanValue(value); + fetchProductsByOrderId(value); + }} + /> + )} - {!isMobile ? - () - : ( { - setScanValue(value); - fetchProductsByOrderId(value); - }} - />)}
{message &&
{message}
} @@ -330,16 +338,7 @@ const VerfiedProducts = ({ drawerOpen = false, setDrawerOpen = () => {} }) => {
{productData.map((order, idx) => (
-
- {/*
-

Order ID

- {order?.OrderId || order?.orderId || scanValue} -
-
-

Sales ID

- {order?.SalesId} -
*/} -
+

diff --git a/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/Verfiedproduct.scss b/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/Verfiedproduct.scss index 4f3b4b7..fbdebed 100644 --- a/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/Verfiedproduct.scss +++ b/src/Pages/BookingScreen/Components/BSNavbar/verfiedProduct/Verfiedproduct.scss @@ -69,9 +69,13 @@ } .SelfBooking-action-bar { display: flex; - gap: 10px; + gap: 16px; margin-bottom: 12px; flex-wrap: wrap; + margin-top: 16px; + .BarCodeScanMaster { + padding: 0 !important; + } } .SelfBooking-action-bar button { @@ -80,17 +84,20 @@ border-radius: 6px; cursor: pointer; font-size: 14px; - font-weight: 500; + font-weight: 400; transition: all 0.2s ease; + font-family: "Poppins"; + height: max-content; + color: #000; } .SelfBooking-action-bar .primary-btn { - background-color: #2563eb; + background-color: #1292ee; color: white; } .SelfBooking-action-bar .primary-btn:hover:not(:disabled) { - background-color: #1d4ed8; + background-color: #0679cc; } .SelfBooking-action-bar button:not(.primary-btn) { diff --git a/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx b/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx index 4d17dfc..5f47613 100644 --- a/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx +++ b/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx @@ -2987,6 +2987,7 @@ const FeaturesFunctionalities = (props) => { Customer Name} autocomplete="off" + autoFocus isOnChange={ formRef.current?.getFieldsValue()?.CustName || inputValue diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx index ec9e8b4..96f86dc 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx @@ -26,6 +26,8 @@ import { IoCloseSharp } from 'react-icons/io5'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import { isMobile } from 'react-device-detect'; import { TfiHandDrag } from 'react-icons/tfi'; +import { TfiArrowsHorizontal } from 'react-icons/tfi'; + import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'; import { DropDowns } from '../../../../Components/Forms/DropDown.jsx'; import { Messages } from '../../../../Components/Notifications/Messages.jsx'; @@ -164,7 +166,9 @@ const BSNavBarDragItems = ({ <>

- { e.stopPropagation(); handleDragToggle(); diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarFavItems.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarFavItems.jsx index 436009d..6b61425 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarFavItems.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarFavItems.jsx @@ -26,8 +26,9 @@ import { SlArrowDown } from 'react-icons/sl'; import { IoCloseSharp } from 'react-icons/io5'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import { isMobile } from 'react-device-detect'; +import '../../../../Styles/BookingScreen/Components/BSNavbar/BSNavbar2.scss'; -const BSNavBarFavItems = ({ type, fill,drawerOpen = false }) => { +const BSNavBarFavItems = ({ type, fill, drawerOpen = false }) => { const [open, setOpen] = useState(false); const [favopen, setFavopen] = useState(false); const globalAllItemdata = useSelector(GlobalAllItemData); @@ -80,11 +81,10 @@ const BSNavBarFavItems = ({ type, fill,drawerOpen = false }) => { useEffect(() => { if (drawerOpen) { AddFav(); - } - else { + } else { setOpen(false); } - }, [drawerOpen]) + }, [drawerOpen]); useEffect(() => { if (preOrderOpen) { @@ -175,7 +175,13 @@ const BSNavBarFavItems = ({ type, fill,drawerOpen = false }) => { e.stopPropagation(); // đŸ‘ˆ prevents parent click AddFav(); }} - fill={globalAllItemdata?.length > 0 ? '#52C41A' : (fill ? fill : '#6b7280')} + fill={ + globalAllItemdata?.length > 0 + ? '#52C41A' + : fill + ? fill + : '#6b7280' + } style={{ cursor: 'pointer', color: globalAllItemdata ? '#52C41A' : 'default', @@ -187,10 +193,7 @@ const BSNavBarFavItems = ({ type, fill,drawerOpen = false }) => { {open && favopen && (
-
+
import('../../Components/BSBillingTables/ListofInvoices/ListOfSalesInvoices.jsx') @@ -328,302 +329,303 @@ const BSLayout2 = () => { setListOfInvoices(false); }; return ( - <> - -
- {UserType != 'Super Admin' && - UserType != 'Super Admin User' && - (AppExpDate?.RemainingDays <= 7 || - AppExpDate === 'undefined' || - AppExpDate?.PlanType?.toLowerCase() === 'extend') && ( - }> - - - )} -
-
- {BookingNavbar == 'Navbar1' && } - {BookingNavbar == 'Navbar2' && } - {BookingNavbar == 'Navbar3' && } -
- + }> + <> + +
+ {UserType != 'Super Admin' && + UserType != 'Super Admin User' && + (AppExpDate?.RemainingDays <= 7 || + AppExpDate === 'undefined' || + AppExpDate?.PlanType?.toLowerCase() === 'extend') && ( + }> + + + )}
- {BookingNavbar != 'Navbar3' ? ( -
+
+ {BookingNavbar == 'Navbar1' && } + {BookingNavbar == 'Navbar2' && } + {BookingNavbar == 'Navbar3' && } +
+ +
+ {BookingNavbar != 'Navbar3' ? (
- {UserType !== 'Employee' && ( -
- {PricingAppPricingName?.[0]?.PricingName + - ' / ' + - PricingAppPricingName?.[0]?.Type} -
- )} - {!OtherServicesglobal && ( - - - - )} - {SessionData?.FeatureAddonData?.FeatureDtls?.find( - (item) => - item?.FeatureAddonName?.toLowerCase() === 'kiosk sales' - ) && - !sportsAppPreference && ( -
0 ? 'none' : 'auto', - opacity: OrderStatus > 0 ? 0.5 : 1, - }} - > - {!OtherServicesglobal && ( - - - openModalKiosk()} - style={{ - cursor: 'pointer', - fontSize: '1.5rem', - }} - className="iconsize" - /> - - - )} +
+ {UserType !== 'Employee' && ( +
+ {PricingAppPricingName?.[0]?.PricingName + + ' / ' + + PricingAppPricingName?.[0]?.Type}
)} - {!OtherServicesglobal && ( - - {' '} - Loading...
}> - - - - )} - {Kioskopen && ( - Loading...
}> - - - )} - - {SAdminuserPin?.length > 0 && - UserType != 'Super Admin User' && ( - Loading...
}> -
- -
+ {!OtherServicesglobal && ( + + )} - {!OtherServicesglobal && ( - <> - {CheckBookingStatus == 'Open' ? ( + {SessionData?.FeatureAddonData?.FeatureDtls?.find( + (item) => + item?.FeatureAddonName?.toLowerCase() === 'kiosk sales' + ) && + !sportsAppPreference && ( +
0 ? 'none' : 'auto', + opacity: OrderStatus > 0 ? 0.5 : 1, + }} + > + {!OtherServicesglobal && ( + + + openModalKiosk()} + style={{ + cursor: 'pointer', + fontSize: '1.5rem', + }} + className="iconsize" + /> + + + )} +
+ )} + {!OtherServicesglobal && ( + + {' '} + + + + + )} + {Kioskopen && ( + + + + )} + + {SAdminuserPin?.length > 0 && + UserType != 'Super Admin User' && ( + +
+ +
+
+ )} + {!OtherServicesglobal && ( + <> + {CheckBookingStatus == 'Open' ? ( +
+ + {' '} + + +
+ ) : ( +
+ + BookingOpenFun('Open')} + > + + + + + +
+ )}
- {' '} -
- ) : ( -
- - BookingOpenFun('Open')} - > - - - - - -
- )} -
- - {''} - - -
- - )} + + )} +
-
- ) : ( - - - - )} + ) : ( + + + + )} -
-
-
- {!OtherServicesglobal && ( - Loading...
}> - - - )} - {OtherServicesglobal && ( - Loading...
}> - - - )} +
+
+
+ {!OtherServicesglobal && ( + + + + )} + {OtherServicesglobal && ( + + + + )} +
+
+ {Comboglobal === false && + !OtherServicesglobal && + (AvailableDate ? ( + + ) : ( + + ))} + {Comboglobal === true && !OtherServicesglobal && ( + + + + )} + {OtherServicesglobal && ( + + + + )} +
-
- {Comboglobal === false && - !OtherServicesglobal && - (AvailableDate ? ( - - ) : ( - - ))} - {Comboglobal === true && !OtherServicesglobal && ( - - - - )} - {OtherServicesglobal && ( - - - - )} -
-
- {/* {PricingAppPricingName?.[0]?.PricingName != 'Standard' ? ( */} - Loading...
}> + {/* {PricingAppPricingName?.[0]?.PricingName != 'Standard' ? ( */} +
{action ? ( ) : ( - Loading...
}> + <> {BSLayout2Data?.BookingBilling?.[0] == 'Billing1' && ( @@ -653,7 +655,7 @@ const BSLayout2 = () => { {BSLayout2Data?.BookingBilling?.[0] == 'StandardBilling' && (
- Loading table...
}> +
@@ -662,30 +664,30 @@ const BSLayout2 = () => {
)}
- +
-
- {BookingModalOpen && ( - - - - )} - {ListOfInvoices && ( - Loading...
}> - - - )} + {BookingModalOpen && ( + + + + )} + {ListOfInvoices && ( + + + + )} - - + + + ); }; diff --git a/src/Pages/Offer/CodeBase/CodeBaseListList.scss b/src/Pages/Offer/CodeBase/CodeBaseListList.scss index 4d819cb..05e9d30 100644 --- a/src/Pages/Offer/CodeBase/CodeBaseListList.scss +++ b/src/Pages/Offer/CodeBase/CodeBaseListList.scss @@ -5,6 +5,7 @@ width: 100%; margin: 0 0 0 0; overflow: auto; + scrollbar-width: thin; padding-bottom: 5rem !important; border-radius: 12px; height: 85vh; diff --git a/src/Pages/Offer/LoyaltyBased/LoyaltiPointList.scss b/src/Pages/Offer/LoyaltyBased/LoyaltiPointList.scss index 2d67257..46c68aa 100644 --- a/src/Pages/Offer/LoyaltyBased/LoyaltiPointList.scss +++ b/src/Pages/Offer/LoyaltyBased/LoyaltiPointList.scss @@ -7,6 +7,7 @@ overflow: auto; margin-bottom: 2rem; border-radius: 12px; + scrollbar-width: thin; @media (max-width: 768px) { margin: 10px 0 0 0; @@ -58,7 +59,7 @@ font-size: 13px; border-radius: 8px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } > div:nth-child(1) { @@ -98,14 +99,14 @@ font-weight: 600; color: #1f2937; // Dark gray, almost black font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; line-height: 1.2; letter-spacing: -0.5px; @@ -116,7 +117,7 @@ font-size: 14px; font-weight: 500; color: #6c6c6c; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; line-height: 1.4; letter-spacing: -0.5px; margin-top: 2px; @@ -179,14 +180,14 @@ font-weight: 500; color: #6c6c6c; // Gray text for inactive state font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; transition: all 0.2s ease; } @@ -206,14 +207,14 @@ font-size: 20px; font-weight: 600; color: #1f2937; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } p { // margin: 0 0 16px 0; font-size: 13px; color: #000000; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; line-height: 1.5; } @@ -225,14 +226,14 @@ font-size: 14px; color: #6c6c6c; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; line-height: 1.6; margin-bottom: 8px; @@ -288,7 +289,7 @@ padding: 4px 4px !important; font-size: 12.5px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .ant-select { @@ -324,7 +325,7 @@ border: none; border-radius: 6px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; transition: all 0.2s ease; flex-shrink: 0; font-size: 24px; @@ -362,7 +363,7 @@ font-size: 13px; letter-spacing: -0.3px; color: #000000; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } } @@ -376,14 +377,14 @@ cursor: pointer; transition: all 0.2s ease; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; &:hover { @@ -398,7 +399,7 @@ border-radius: 6px; font-size: 14px; color: #374151; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; width: 190px; &:focus { @@ -433,7 +434,7 @@ background-color: #2563ea !important; height: 42px !important; padding: 10px !important; - font-family: 'Poppins', sans-serif !important; + font-family: "Poppins", sans-serif !important; } button:nth-child(1) { @@ -452,7 +453,7 @@ cursor: pointer; border-radius: 8px; font-size: 14px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; display: flex; align-items: center; gap: 6px; @@ -473,7 +474,7 @@ width: max-content; .offercount { - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; font-size: 14px; color: #878787; } @@ -484,7 +485,7 @@ margin-top: 10px; grid-column: 1 / -1; background-color: #fff; - border-radius: 10px; + border-radius: 10px; width: 100%; .ant-table-thead { position: unset !important; @@ -506,7 +507,7 @@ cursor: pointer; font-size: 11px; font-weight: 400; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; transition: all 0.2s ease; &:hover { @@ -574,14 +575,14 @@ color: #374151; border-bottom: 1px solid #e2e8f0; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; } @@ -591,14 +592,14 @@ color: #374151; border-bottom: 1px solid #e2e8f0; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; } @@ -700,7 +701,7 @@ border: 1px solid #565656 !important; border-radius: 8px; font-size: 13px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; &:focus { outline: none; @@ -722,7 +723,7 @@ border: 1px solid #565656 !important; border-radius: 8px; font-size: 13px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; &:focus { outline: none; @@ -743,7 +744,7 @@ border-radius: 8px; cursor: pointer; font-size: 13px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; svg { width: 16px; @@ -768,7 +769,7 @@ border-radius: 10px; font-size: 12px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; .chip-remove { background: none; @@ -792,7 +793,7 @@ color: #6b7280; margin-top: 6px; margin-bottom: 0; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .modal-button-group { @@ -809,7 +810,7 @@ color: #6b7280; font-size: 14px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .modal-submit-button { @@ -820,7 +821,7 @@ font-size: 13px; border-radius: 8px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .modal-title { @@ -829,7 +830,7 @@ color: #1f2937; margin: 0 0 8px 0; -webkit-text-stroke-width: 0.1px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .modal-label { @@ -838,7 +839,7 @@ font-weight: 500; color: #374151; margin-bottom: 8px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .modal-input-row { @@ -878,7 +879,7 @@ font-weight: 500; border-radius: 6px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .radio-options { @@ -897,14 +898,14 @@ gap: 10px; font-size: 14px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; background-color: #2563ea1a; border: 1px solid #2563ea40; padding: 4px 8px; border-radius: 6px; color: #000000; font-weight: 400; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; // -webkit-text-stroke-width: 0.2px; } @@ -921,10 +922,10 @@ cursor: pointer; font-size: 14px; color: #374151; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } -.radio-option input[type='radio'] { +.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: #2563ea; @@ -939,7 +940,7 @@ font-weight: 500; border-radius: 6px; cursor: pointer; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } // Days Section Styles @@ -957,14 +958,14 @@ font-weight: 500; color: #374151; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; } @@ -978,14 +979,14 @@ cursor: pointer; transition: all 0.2s ease; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; &:hover { @@ -1015,17 +1016,17 @@ font-size: 14px; color: #374151; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; - input[type='checkbox'] { + input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3b82f6; @@ -1047,14 +1048,14 @@ font-size: 12px; color: #6b7280; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; } } @@ -1067,14 +1068,14 @@ color: #374151; background: #ffffff; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; &:focus { @@ -1092,14 +1093,14 @@ font-weight: 500; color: #2563ea; font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', + "Segoe UI", + "Roboto", + "Oxygen", + "Ubuntu", + "Cantarell", sans-serif; margin-top: 8px; } @@ -1107,11 +1108,11 @@ .days-selected { font-size: 14px; color: #6b7280; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; background-color: rgba(37, 99, 234, 0.1019607843); padding: 8px 8px; color: #2563ea; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; border-radius: 8px; line-height: 1.5; border: rgba(37, 99, 234, 0.4431372549) 1px solid; @@ -1148,7 +1149,7 @@ font-size: 13px; font-weight: 400; -webkit-text-stroke-width: 0.2px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; position: relative; bottom: 6px; } @@ -1164,7 +1165,7 @@ background: rgba(37, 99, 234, 0.1019607843); border: rgba(37, 99, 234, 0.4431372549) 1px solid; border-radius: 6px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .applied-label { @@ -1247,7 +1248,7 @@ color: #000000; -webkit-text-stroke-width: 0.2px; margin-bottom: 0; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; display: flex; align-items: center; gap: 4px; @@ -1275,7 +1276,7 @@ padding: 4px 4px !important; font-size: 12.5px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } } @@ -1283,7 +1284,7 @@ font-size: 14px; color: #6b7280; margin: 0; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .mapping-label { @@ -1291,7 +1292,7 @@ font-size: 13px; font-weight: 400; color: #374151; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .product-list { @@ -1308,7 +1309,7 @@ border-radius: 4px; font-size: 14px; color: #374151; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; display: flex; align-items: center; justify-content: space-between; @@ -1367,7 +1368,7 @@ font-weight: 400; cursor: pointer; transition: all 0.2s ease; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; &:hover { background: #1d4ed8; @@ -1412,7 +1413,7 @@ background: #f3f4f6; padding: 2px 8px; border-radius: 12px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .OfferBreadcrumbs { @@ -1431,7 +1432,7 @@ gap: 2px; font-size: 10px; font-weight: 400; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; cursor: pointer; color: #676767; @@ -1461,7 +1462,7 @@ font-weight: 400; // -webkit-text-stroke-width: 0.1px; transition: all 0.2s ease; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; &.active { background: #2563ea; @@ -1517,7 +1518,7 @@ color: #1e1e1e; margin: 17px 6px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; -webkit-text-stroke-width: 0.1px; } @@ -1623,7 +1624,7 @@ cursor: pointer; font-size: 12px; font-weight: 400; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; transition: all 0.2s ease; } } @@ -1643,7 +1644,7 @@ border-radius: 6px; transition: all 0.2s ease; - input[type='checkbox'] { + input[type="checkbox"] { width: 16px; height: 16px; accent-color: #2563ea; @@ -1673,7 +1674,7 @@ font-size: 12px; -webkit-text-stroke-width: 0.1px; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .edit-days-button { @@ -1702,7 +1703,7 @@ font-size: 13px; font-weight: 400; -webkit-text-stroke-width: 0.2px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; position: relative; bottom: 6px; } @@ -1717,7 +1718,7 @@ gap: 8px; cursor: pointer; - input[type='radio'] { + input[type="radio"] { width: 16px; height: 16px; accent-color: #2563ea; @@ -1727,7 +1728,7 @@ font-size: 12px; color: #000000; font-weight: 500; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } } } @@ -1751,11 +1752,11 @@ .date-picker { width: 100%; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; .ant-picker-input { font-size: 14px; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; &:focus { outline: none; @@ -1770,11 +1771,11 @@ // Override Ant Design default styles .ant-picker { - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } .ant-picker-input > input { - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; } } } diff --git a/src/Pages/Offer/Offer/OfferList.scss b/src/Pages/Offer/Offer/OfferList.scss index 90098fd..2286589 100644 --- a/src/Pages/Offer/Offer/OfferList.scss +++ b/src/Pages/Offer/Offer/OfferList.scss @@ -5,6 +5,7 @@ width: 100%; margin: 0 0 0 0; overflow: auto; + scrollbar-width: thin; margin-bottom: 2rem; border-radius: 12px; diff --git a/src/Services/BarCodeScan.jsx b/src/Services/BarCodeScan.jsx index 4e2c71c..84043bf 100644 --- a/src/Services/BarCodeScan.jsx +++ b/src/Services/BarCodeScan.jsx @@ -148,272 +148,240 @@ // ); // } -import React, { useRef, useState, useEffect } from "react"; -import { BarcodeScanner } from "@capacitor-mlkit/barcode-scanning"; -import { BsUpcScan } from "react-icons/bs"; -import { Capacitor } from "@capacitor/core"; -import { DefaultModal } from "../Components/Modal/DefaultModal"; -import QrScanner from "qr-scanner/qr-scanner.min.js"; -import { - BrowserMultiFormatReader, - BarcodeFormat, -} from "@zxing/library"; +import React, { useRef, useState, useEffect } from 'react'; +import { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'; +import { BsUpcScan } from 'react-icons/bs'; +import { Capacitor } from '@capacitor/core'; +import { DefaultModal } from '../Components/Modal/DefaultModal'; +import QrScanner from 'qr-scanner/qr-scanner.min.js'; +import { BrowserMultiFormatReader, BarcodeFormat } from '@zxing/library'; QrScanner.WORKER_PATH = new URL( - "qr-scanner/qr-scanner-worker.min.js", - import.meta.url + 'qr-scanner/qr-scanner-worker.min.js', + import.meta.url ).toString(); export default function BarCodeScan({ onScan }) { - const isMobileApp = Capacitor.getPlatform() !== "web"; - const [scanning, setScanning] = useState(false); - const [modalOpen, setModalOpen] = useState(false); + const isMobileApp = Capacitor.getPlatform() !== 'web'; + const [scanning, setScanning] = useState(false); + const [modalOpen, setModalOpen] = useState(false); - const videoRef = useRef(null); - const qrScannerRef = useRef(null); - const barcodeReaderRef = useRef(null); + const videoRef = useRef(null); + const qrScannerRef = useRef(null); + const barcodeReaderRef = useRef(null); - // ------------------------- - // START SCAN - // ------------------------- - const startScan = async () => { - if (scanning) return; - setScanning(true); + // ------------------------- + // START SCAN + // ------------------------- + const startScan = async () => { + if (scanning) return; + setScanning(true); - if (isMobileApp) { - try { - const perm = await BarcodeScanner.requestPermissions(); - if (perm.camera !== "granted") { - alert("Camera permission not granted"); - setScanning(false); - return; - } - - const { barcodes } = await BarcodeScanner.scan(); - if (barcodes?.length > 0) { - onScan(barcodes[0].rawValue); - } - } catch (err) { - console.error(err); - } finally { - setScanning(false); - } - } else { - setModalOpen(true); - } - }; - - // ------------------------- - // START WEB SCAN (HYBRID) - // ------------------------- - const startWebScan = async () => { - if (!videoRef.current) return; - - // Start QR scanner (fast) - qrScannerRef.current = new QrScanner( - videoRef.current, - (result) => { - stopWebScan(); - onScan(result.data); - setModalOpen(false); - }, - { - maxScansPerSecond: 25, - } - ); - - await qrScannerRef.current.start(); - - // Start Barcode scanner (ZXing) - barcodeReaderRef.current = new BrowserMultiFormatReader(undefined, { - possibleFormats: [ - BarcodeFormat.CODE_128, - BarcodeFormat.EAN_13, - BarcodeFormat.UPC_A, - BarcodeFormat.UPC_E, - ], - }); - - barcodeReaderRef.current.timeBetweenDecodingAttempts = 50; - - barcodeReaderRef.current.decodeFromVideoDevice( - null, - videoRef.current, - (result) => { - if (result) { - stopWebScan(); - onScan(result.getText()); - setModalOpen(false); - } - } - ); - }; - - const stopWebScan = () => { - if (qrScannerRef.current) { - qrScannerRef.current.stop(); - qrScannerRef.current.destroy(); - qrScannerRef.current = null; + if (isMobileApp) { + try { + const perm = await BarcodeScanner.requestPermissions(); + if (perm.camera !== 'granted') { + alert('Camera permission not granted'); + setScanning(false); + return; } - if (barcodeReaderRef.current) { - barcodeReaderRef.current.reset(); - barcodeReaderRef.current = null; + const { barcodes } = await BarcodeScanner.scan(); + if (barcodes?.length > 0) { + onScan(barcodes[0].rawValue); } - + } catch (err) { + console.error(err); + } finally { setScanning(false); - }; + } + } else { + setModalOpen(true); + } + }; - const closeModal = () => { + // ------------------------- + // START WEB SCAN (HYBRID) + // ------------------------- + const startWebScan = async () => { + if (!videoRef.current) return; + + // Start QR scanner (fast) + qrScannerRef.current = new QrScanner( + videoRef.current, + (result) => { stopWebScan(); + onScan(result.data); setModalOpen(false); - }; + }, + { + maxScansPerSecond: 25, + } + ); - useEffect(() => { - if (modalOpen) { - startWebScan(); + await qrScannerRef.current.start(); + + // Start Barcode scanner (ZXing) + barcodeReaderRef.current = new BrowserMultiFormatReader(undefined, { + possibleFormats: [ + BarcodeFormat.CODE_128, + BarcodeFormat.EAN_13, + BarcodeFormat.UPC_A, + BarcodeFormat.UPC_E, + ], + }); + + barcodeReaderRef.current.timeBetweenDecodingAttempts = 50; + + barcodeReaderRef.current.decodeFromVideoDevice( + null, + videoRef.current, + (result) => { + if (result) { + stopWebScan(); + onScan(result.getText()); + setModalOpen(false); } - }, [modalOpen]); + } + ); + }; - useEffect(() => { - return () => stopWebScan(); - }, []); + const stopWebScan = () => { + if (qrScannerRef.current) { + qrScannerRef.current.stop(); + qrScannerRef.current.destroy(); + qrScannerRef.current = null; + } - return ( -
- {!scanning && ( - - )} + if (barcodeReaderRef.current) { + barcodeReaderRef.current.reset(); + barcodeReaderRef.current = null; + } - {/* -
-
+ setScanning(false); + }; - -
*/} - + const closeModal = () => { + stopWebScan(); + setModalOpen(false); + }; + + useEffect(() => { + if (modalOpen) { + startWebScan(); + } + }, [modalOpen]); + + useEffect(() => { + return () => stopWebScan(); + }, []); + + return (
- {/* VIDEO */} -