diff --git a/src/app/router/index.tsx b/src/app/router/index.tsx index 20cbeb0..cf29dbe 100644 --- a/src/app/router/index.tsx +++ b/src/app/router/index.tsx @@ -112,6 +112,7 @@ const ActivityLogViewPage = lazy(() => import("@/pages/logs/view")); const BranchCreatePage = lazy(() => import("@/pages/settings/location/branchesCreate")); const BranchesViewPage = lazy(() => import("@/pages/settings/location/branchesView")); const BranchEditPage = lazy(() => import("@/pages/settings/location/branchesEdit")); +const PaymentSettingsPage = lazy(() => import("@/pages/settings/payment")); const ProfilePage = lazy(() => import("@/pages/profile")); // ─── Guards ─────────────────────────────────────────────────────────────────── @@ -800,6 +801,11 @@ const routes: AppRoute[] = [ }, ], }, + // Payment settings + { + ...bc((t) => t("paymentSettings.title", "Töleg sazlamalary"), "/settings/payment"), + children: [{ path: "/settings/payment", element: page(PaymentSettingsPage) }], + }, ], }, ], diff --git a/src/components/infiniteSelect.tsx b/src/components/infiniteSelect.tsx index 03012d6..916490d 100644 --- a/src/components/infiniteSelect.tsx +++ b/src/components/infiniteSelect.tsx @@ -53,7 +53,31 @@ export function InfiniteSelect({ onSearchChange, }: InfiniteSelectProps) { const [open, setOpen] = useState(false); + const containerRef = useRef(null); + const scrollContainerRef = useRef(null); const sentinelRef = useRef(null); + const [portalContainer, setPortalContainer] = useState(undefined); + + useEffect(() => { + if (containerRef.current) { + const dialog = containerRef.current.closest( + '[role="dialog"], [role="alertdialog"], [data-slot="alert-dialog-content"], [data-slot="dialog-content"]', + ); + if (dialog) { + setPortalContainer(dialog); + } + } + }, []); + + useEffect(() => { + const el = scrollContainerRef.current; + if (!el || !open) return; + const handleWheel = (e: WheelEvent) => { + e.stopPropagation(); + }; + el.addEventListener("wheel", handleWheel, { passive: true }); + return () => el.removeEventListener("wheel", handleWheel); + }, [open]); const selected = options.find((o) => o.value === value); @@ -93,7 +117,7 @@ export function InfiniteSelect({ }, [open, hasNextPage, isLoadingMore, onLoadMore]); return ( -
+
{label && (