diff --git a/src/routes/Tool/Tool.tsx b/src/routes/Tool/Tool.tsx index 6f246fe2..b533c9b2 100644 --- a/src/routes/Tool/Tool.tsx +++ b/src/routes/Tool/Tool.tsx @@ -1,5 +1,6 @@ import { OpportunityCard, Title } from '@/components'; import { useEnvironment } from '@/hooks/useEnvironment'; +import { useMenuClickHandler } from '@/hooks/useMenuClickHandler'; import { OpportunitiesFilter } from '@/routes/Tool'; import { MahdollisuusTyyppi } from '@/routes/types'; import { useToolStore } from '@/stores/useToolStore'; @@ -261,6 +262,9 @@ const YourOpportunities = () => { const scrollRef = React.useRef(null); const { isLoggedIn } = useLoaderData() as ToolLoaderData; const [filtersOpen, setFiltersOpen] = React.useState(false); + const filterMenuButtonRef = React.useRef(null); + const filterMenuRef = useMenuClickHandler(() => setFiltersOpen(false), filterMenuButtonRef); + const ehdotuksetCount = toolStore.ehdotuksetCount ?? {}; const filter = toolStore.filter; const count = @@ -282,12 +286,17 @@ const YourOpportunities = () => {