diff --git a/app/lib/utils.ts b/app/lib/utils.ts index b5ded23f..112905f0 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -186,6 +186,7 @@ function parseItem(primaryDomain: string, env: Env, customPrefixes = {}) { return { ...parsedItem, items: item.items + // @ts-ignore .map(parseItem(primaryDomain, env, customPrefixes)) .filter(Boolean), } as EnhancedMenu["items"][number]; diff --git a/app/modules/DrawerFilter.tsx b/app/modules/DrawerFilter.tsx index 8327b2e6..b679c37c 100644 --- a/app/modules/DrawerFilter.tsx +++ b/app/modules/DrawerFilter.tsx @@ -9,32 +9,24 @@ import type { Filter, ProductFilter, } from "@shopify/hydrogen/storefront-api-types"; +import clsx from "clsx"; import type { SyntheticEvent } from "react"; -import { useMemo, useState } from "react"; -import { useDebounce } from "react-use"; -import { Drawer, useDrawer } from "./Drawer"; -import { - AppliedFilter, - SortParam, - filterInputToParams, - getAppliedFilterLink, - getFilterLink, - getSortLink, -} from "~/lib/filter"; -import { Button } from "./Button"; +import { useState } from "react"; import { Checkbox } from "~/components/Checkbox"; import { FILTER_URL_PREFIX } from "~/lib/const"; +import type { AppliedFilter, SortParam } from "~/lib/filter"; +import { getAppliedFilterLink, getFilterLink, getSortLink } from "~/lib/filter"; +import { Input } from "."; +import { Button } from "./Button"; +import { Drawer, useDrawer } from "./Drawer"; import { IconCaret, - IconFilters, IconFourGrid, IconOneGrid, IconSliders, IconThreeGrid, IconTwoGrid, } from "./Icon"; -import { Input } from "."; -import clsx from "clsx"; type DrawerFilterProps = { productNumber?: number; @@ -65,6 +57,7 @@ export function DrawerFilter({ numberInRow === 4 && " border-[#88847F]", )} onClick={() => onLayoutChange(4)} + role="button" > @@ -74,6 +67,7 @@ export function DrawerFilter({ numberInRow === 3 && " border-[#88847F]", )} onClick={() => onLayoutChange(3)} + role="button" > @@ -83,6 +77,7 @@ export function DrawerFilter({ numberInRow === 4 && "border-[#88847F]", )} onClick={() => onLayoutChange(4)} + role="button" > @@ -92,6 +87,7 @@ export function DrawerFilter({ numberInRow === 3 && "border-[#88847F]", )} onClick={() => onLayoutChange(3)} + role="button" > @@ -114,6 +110,7 @@ export function DrawerFilter({ heading="Filter" >
+ {/* @ts-expect-error */} new URLSearchParams(location.search), - [location.search], - ); - const navigate = useNavigate(); + // const location = useLocation(); + // const params = useMemo( + // () => new URLSearchParams(location.search), + // [location.search], + // ); + // const navigate = useNavigate(); const [minPrice, setMinPrice] = useState(min); const [maxPrice, setMaxPrice] = useState(max); @@ -264,7 +261,7 @@ function PriceRangeFilter({ max, min }: { max?: number; min?: number }) { return (
-