Skip to content

Commit

Permalink
fix typecheck and removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpprieto committed Jun 26, 2023
1 parent bdde4ae commit 63ff836
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions templates/demo-store/app/components/SortFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import {
} from '@remix-run/react';
import {useDebounce} from 'react-use';
import {Disclosure} from '@headlessui/react';
import type {
FilterType,
Filter,
Collection,
} from '@shopify/hydrogen/storefront-api-types';
import type {FilterType, Filter} from '@shopify/hydrogen/storefront-api-types';

import {Heading, IconFilters, IconCaret, IconXMark, Text} from '~/components';

Expand Down Expand Up @@ -83,7 +79,6 @@ export function SortFilter({
export function FiltersDrawer({
filters = [],
appliedFilters = [],
collections = [],
}: Omit<Props, 'children'>) {
const [params] = useSearchParams();
const location = useLocation();
Expand Down Expand Up @@ -122,21 +117,6 @@ export function FiltersDrawer({
}
};

const collectionsMarkup = collections.map((collection) => {
return (
<li key={collection.handle} className="pb-4">
<Link
to={`/collections/${collection.handle}`}
className="focus:underline hover:underline"
key={collection.handle}
prefetch="intent"
>
{collection.title}
</Link>
</li>
);
});

return (
<>
<nav className="py-8">
Expand Down Expand Up @@ -326,7 +306,9 @@ function filterInputToParams(
rawInput: string | Record<string, any>,
params: URLSearchParams,
) {
const input = typeof rawInput === 'string' ? JSON.parse(rawInput) : rawInput;
const input = (
typeof rawInput === 'string' ? JSON.parse(rawInput) : rawInput
) as Record<string, any>;
switch (type) {
case 'PRICE_RANGE':
if (input.price.min) params.set('minPrice', input.price.min);
Expand Down

0 comments on commit 63ff836

Please sign in to comment.