|
1 | 1 | import { observer } from "mobx-react"; |
2 | | -import { ListFilter } from "lucide-react"; |
3 | 2 | // plane imports |
| 3 | +import { IconButton } from "@plane/propel/icon-button"; |
| 4 | +import { FilterIcon, FilterAppliedIcon } from "@plane/propel/icons"; |
| 5 | +import { cn } from "@plane/utils"; |
4 | 6 | import type { IFilterInstance } from "@plane/shared-state"; |
5 | 7 | import type { TExternalFilter, TFilterProperty } from "@plane/types"; |
6 | | -import { cn } from "@plane/ui"; |
7 | 8 | // components |
8 | 9 | import { AddFilterButton } from "@/components/rich-filters/add-filters/button"; |
9 | 10 |
|
@@ -49,28 +50,14 @@ export const FiltersToggle = observer(function FiltersToggle<P extends TFilterPr |
49 | 50 | } |
50 | 51 |
|
51 | 52 | return ( |
52 | | - <button |
53 | | - className={cn(COMMON_CLASSNAME, { |
54 | | - "border-transparent bg-accent-primary/10 hover:bg-accent-primary/20": isFilterRowVisible, |
55 | | - "hover:bg-surface-1": !isFilterRowVisible, |
56 | | - })} |
| 53 | + <IconButton |
| 54 | + size="lg" |
| 55 | + variant="secondary" |
| 56 | + icon={showFilterRowChangesPill ? FilterAppliedIcon : FilterIcon} |
57 | 57 | onClick={handleToggleFilter} |
58 | | - > |
59 | | - <div className="relative"> |
60 | | - <ListFilter |
61 | | - className={cn("size-4", { |
62 | | - "text-accent-primary": isFilterRowVisible, |
63 | | - "text-tertiary": !isFilterRowVisible, |
64 | | - })} |
65 | | - /> |
66 | | - {showFilterRowChangesPill && ( |
67 | | - <span |
68 | | - className={cn("p-[3px] rounded-full bg-accent-primary absolute top-[0.2px] -right-[0.4px]", { |
69 | | - "bg-layer-1": hasAnyConditions === false && filter?.hasChanges === true, // If there are no conditions and there are changes, show the pill in the background color |
70 | | - })} |
71 | | - /> |
72 | | - )} |
73 | | - </div> |
74 | | - </button> |
| 58 | + className={cn({ |
| 59 | + "text-accent-primary bg-accent-subtle border border-accent-subtle-1": showFilterRowChangesPill, |
| 60 | + })} |
| 61 | + /> |
75 | 62 | ); |
76 | 63 | }); |
0 commit comments