Sammy/t 134 i see all filters in the dropdown (#78)

* feature: add filter dropdown

* test: add story for FilterDropdown

* feature: display filterOperand on top of dropdown

* feature: display filter operand

* feature: fix index and display selected filter

* refactor: set TopOption button inside dropdown file

* feature: move availableFilters outside the fitler component

* refactor: make the available sorts and filter optionnal

* refactor: rename availableSorts

* feature: add a resetState property on onOutsideClick

* feature: add filters and set  filters on Dropdown component

* feature: set filters on click in dropdown

* test: verify button is active after filters are set

* feature: display sorts and filters

* refactor: move SelectedFilters in SortAndFilter

* refactor: move SelectedFilters in dedicated file

* refactor: remove Id and use Key
This commit is contained in:
Sammy Teillet
2023-04-26 16:19:34 +02:00
committed by GitHub
parent 1c8a4058c3
commit 5aec7ca730
17 changed files with 521 additions and 70 deletions

View File

@ -0,0 +1,25 @@
import { IconProp } from '@fortawesome/fontawesome-svg-core';
export type SortType<SortKey = string> = {
label: string;
key: SortKey;
icon?: IconProp;
};
export type FilterType<FilterKey = string> = {
label: string;
key: FilterKey;
icon: IconProp;
};
export type SelectedFilterType = {
id: string;
label: string;
value: string;
operand: { id: string; label: string };
icon: IconProp;
};
export type SelectedSortType<SortField = string> = SortType<SortField> & {
order: 'asc' | 'desc';
};