Skip to content

Commit

Permalink
feat(redmine 1246959): integration of active fiters zone
Browse files Browse the repository at this point in the history
  • Loading branch information
vapersmile committed Nov 13, 2023
1 parent 9d7399a commit 3b1bf2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,15 @@ export default meta;
type IStory = StoryObj<typeof meta>;

export const Filters: IStory = {
args: {},
args: {
activeFilters: [
{
id: 1,
label: 'Dupont',
value: 'Dupont',
},
],
deleteButtonLabel: 'Supprimer tout',
title: 'Filters actifs',
},
};
68 changes: 2 additions & 66 deletions packages/react-front-kit/src/Components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useStyles } from './Filters.style';
export interface ISidebarFilter {
id: number | string;
label: string;
onRemove: (filter: ISidebarFilter) => void;
onRemove?: (filter: ISidebarFilter) => void;
value: unknown;
}

Expand All @@ -31,70 +31,6 @@ export function Filters(props: IFiltersProps): ReactElement {
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
{
id: 2,
label: 'truck',
onRemove: (filter: ISidebarFilter) => {
console.log(filter);
},
value: 'truck',
},
],
title = 'Active filters',
deleteButtonLabel = 'Remove all',
Expand Down Expand Up @@ -122,7 +58,7 @@ export function Filters(props: IFiltersProps): ReactElement {
rightSection: classes.badgeRight,
root: classes.badgeRoot,
}}
onClick={() => filter.onRemove(filter)}
onClick={() => filter.onRemove && filter.onRemove(filter)}
pr={3}
rightSection={<X size={10} />}
size="xl"
Expand Down

0 comments on commit 3b1bf2c

Please sign in to comment.