Skip to content

Commit

Permalink
feat: APP-545 mobile projects filters (#2595)
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi authored Feb 13, 2025
1 parent 77cf40a commit 56601df
Show file tree
Hide file tree
Showing 19 changed files with 583 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ export const hasChangedFilters = (
) =>
Object.values(selectedFilters).filter(value => value).length !==
Object.values(initialFilters).filter(value => value).length;

export const countChangedFilters = (
selectedFilters: Record<string, boolean>,
initialFilters: Record<string, boolean>,
) => (hasChangedFilters(selectedFilters, initialFilters) ? 1 : 0);

export const countChangedBoolFilters = (
selectedFilter: boolean | undefined,
initialFilter: boolean,
) => (selectedFilter !== initialFilter ? 1 : 0);
2 changes: 1 addition & 1 deletion web-marketplace/src/lib/atoms/projects.atoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { sortOptions } from 'pages/Projects/AllProjects/AllProjects.config';
export const showCommunityProjectsAtom = atom<boolean | undefined>(
DEFAULT_COMMUNITY_PROJECTS_FILTER,
);
export const creditClassSelectedFiltersAtom = atom<Record<string, boolean>>({});
export const creditClassFiltersAtom = atom<Record<string, boolean>>({});
export const creditClassInitialFiltersAtom = atom<Record<string, boolean>>({});
export const projectsSortAtom = atom(sortOptions[0].value);

Expand Down
Loading

0 comments on commit 56601df

Please sign in to comment.