mirror of
https://github.com/vercel/commerce.git
synced 2025-05-07 10:17:50 +00:00
Merge 4bd23011ff419fb5e565f5305bb666e25483dac4 into fa1306916c652ea5f820d5b400087bece13460fd
This commit is contained in:
commit
a83d5504d6
@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import { usePathname, useSearchParams } from 'next/navigation';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { SVGProps, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { ChevronDownIcon } from '@heroicons/react/24/outline';
|
||||
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
|
||||
import type { ListItem } from '.';
|
||||
import { FilterItem } from './item';
|
||||
|
||||
@ -36,6 +36,9 @@ export default function FilterItemDropdown({ list }: { list: ListItem[] }) {
|
||||
});
|
||||
}, [pathname, list, searchParams]);
|
||||
|
||||
const ChevronUpDownIcon = (props: SVGProps<SVGSVGElement>) =>
|
||||
openSelect ? <ChevronUpIcon {...props} /> : <ChevronDownIcon {...props} />;
|
||||
|
||||
return (
|
||||
<div className="relative" ref={ref}>
|
||||
<div
|
||||
@ -45,7 +48,7 @@ export default function FilterItemDropdown({ list }: { list: ListItem[] }) {
|
||||
className="flex w-full items-center justify-between rounded-sm border border-black/30 px-4 py-2 text-sm dark:border-white/30"
|
||||
>
|
||||
<div>{active}</div>
|
||||
<ChevronDownIcon className="h-4" />
|
||||
<ChevronUpDownIcon className="h-4" />
|
||||
</div>
|
||||
{openSelect && (
|
||||
<div
|
||||
|
Loading…
x
Reference in New Issue
Block a user