From fb00cff3b3f167a4fb823b21cf66d63f4fa0f0c5 Mon Sep 17 00:00:00 2001 From: Leandro Palazzolo Date: Mon, 8 Jan 2024 19:21:00 -0300 Subject: [PATCH] refactor: individual clear filter --- assets/icons.tsx | 12 +++++++++++- components/filters/select-filter.tsx | 6 +++++- components/filters/toolbar.tsx | 21 +++------------------ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/assets/icons.tsx b/assets/icons.tsx index 4e4b335..e2a7ac1 100644 --- a/assets/icons.tsx +++ b/assets/icons.tsx @@ -1,6 +1,16 @@ import * as React from "react"; import { IconSvgProps } from "@/types/index"; - +export const CircledCross = ({ size = 24, + width, + height, + ...props }: IconSvgProps) => ( + + +) export const HeartFilledIcon = ({ size = 24, width, diff --git a/components/filters/select-filter.tsx b/components/filters/select-filter.tsx index 28e2df4..3eb094c 100644 --- a/components/filters/select-filter.tsx +++ b/components/filters/select-filter.tsx @@ -6,6 +6,7 @@ import { Select, SelectItem } from "@nextui-org/select"; import { FilterOption } from "@/types/filters"; import { createUrl } from "@/utils/url"; import Emoji from "../emoji"; +import { CircledCross } from "@/assets/icons"; interface ISelectFilterProps { placeholder: string; @@ -39,7 +40,9 @@ export const SelectFilter = ({ router.replace(optionUrl, { scroll: false }); }; - + const resetFilter = () => { + handleSelectionChange("") + } return (