Skip to content

Commit

Permalink
feat: render experiencefilter as fra til (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
olavbm authored Jun 14, 2024
1 parent ece9cce commit 95feade
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/src/components/ActiveFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ export default function ActiveFilters() {
const { filteredDepartments } = useDepartmentFilter();
const { filteredYears } = useRawYearsFilter();
const { availabilityFilterOn } = useAvailabilityFilter();
const { experienceFromFilter, experienceToFilter } = activeFilters;

if (experienceFromFilter != "" && experienceToFilter == "") {
filterTextComponents.push(`Fra ${experienceFromFilter} års erfaring`);
}

if (experienceFromFilter == "" && experienceToFilter != "") {
filterTextComponents.push(`Til ${experienceToFilter} års erfaring`);
}

if (experienceFromFilter != "" && experienceToFilter != "") {
filterTextComponents.push(
`Fra ${experienceFromFilter} til ${experienceToFilter} års erfaring`,
);
}

if (searchFilter != "") filterTextComponents.push(` "${searchFilter}"`);

Expand Down

0 comments on commit 95feade

Please sign in to comment.