diff --git a/src/components/layout/MobileMenu.tsx b/src/components/layout/MobileMenu.tsx index 0996d0da..cb43dbf8 100644 --- a/src/components/layout/MobileMenu.tsx +++ b/src/components/layout/MobileMenu.tsx @@ -3,7 +3,6 @@ import type { Category } from "@spree/sdk"; import { ArrowLeft, Check, ChevronRight, User, X } from "lucide-react"; import Link from "next/link"; -import { useRouter } from "next/navigation"; import { useRef, useState } from "react"; import { flushSync } from "react-dom"; import { Button } from "@/components/ui/button"; @@ -46,7 +45,6 @@ export function MobileMenu({ rootCategories, basePath }: MobileMenuProps) { const timeoutRef = useRef(null); const { country, currency, countries } = useStore(); - const router = useRouter(); const { isCountryNavigating, handleCountrySelect } = useCountrySwitch({ currentCountry: country, onBeforeNavigate: () => setOpen(false), @@ -98,11 +96,6 @@ export function MobileMenu({ rootCategories, basePath }: MobileMenuProps) { } }; - const handleNavigate = (href: string) => { - setOpen(false); - router.push(href); - }; - // Flatten root categories: show their children directly instead of taxonomy names const menuCategories = rootCategories.flatMap((root) => root.children ?? []); @@ -225,20 +218,20 @@ export function MobileMenu({ rootCategories, basePath }: MobileMenuProps) { }`} > {/* Footer: Country switcher (mobile + tablet) + Account (mobile only) */} @@ -342,33 +333,27 @@ export function MobileMenu({ rootCategories, basePath }: MobileMenuProps) { ) : ( - + ), )} {/* "View all" at the bottom */}
- +
); diff --git a/src/components/products/filters/ProductFilters.tsx b/src/components/products/filters/ProductFilters.tsx index 32f76917..268e50e3 100644 --- a/src/components/products/filters/ProductFilters.tsx +++ b/src/components/products/filters/ProductFilters.tsx @@ -131,20 +131,21 @@ export const FilterBar = memo(function FilterBar({ const activeSortBy = activeFilters.sortBy || filtersData?.default_sort; - if (filtersLoading) { - return ( -
-
-
-
-
-
-
- ); + if (!filtersData) { + if (filtersLoading) { + return ( +
+
+
+
+
+
+
+ ); + } + return null; } - if (!filtersData) return null; - const availabilityFilter = filtersData.filters.find( (f) => f.type === "availability", ) as AvailabilityFilter | undefined;