feat(SW-1883): Added links to the filter values on the destination pages

Approved-by: Fredrik Thorsson
This commit is contained in:
Erik Tiekstra
2025-03-27 09:06:31 +00:00
parent 992d24c753
commit 93c7fe64bf
3 changed files with 24 additions and 0 deletions

View File

@@ -74,6 +74,10 @@
padding: 0;
}
.visuallyHidden {
display: none;
}
@media screen and (max-width: 767px) {
.overlay {
height: var(--visual-viewport-height);

View File

@@ -1,5 +1,6 @@
"use client"
import Link from "next/link"
import { useRouter } from "next/navigation"
import {
Dialog,
@@ -60,6 +61,7 @@ export default function DestinationFilterAndSort({
resetPendingValues: state.actions.resetPendingValues,
setIsLoading: state.actions.setIsLoading,
}))
const { facilityFilters, surroundingsFilters } = filters
const alertHeading =
listType === "city"
? intl.formatMessage({ id: "No matching locations found" })
@@ -189,6 +191,22 @@ export default function DestinationFilterAndSort({
</Modal>
</ModalOverlay>
</DialogTrigger>
{/* This section is added to the DOM for SEO purposes. The filters are linkable and should be indexable */}
<nav className={styles.visuallyHidden}>
<ul>
{facilityFilters.map((filter) => (
<li key={`filter-${filter.slug}`}>
<Link href={`${basePath}/${filter.slug}`}>{filter.name}</Link>
</li>
))}
{surroundingsFilters.map((filter) => (
<li key={`filter-${filter.slug}`}>
<Link href={`${basePath}/${filter.slug}`}>{filter.name}</Link>
</li>
))}
</ul>
</nav>
</>
)
}

View File

@@ -1,3 +1,5 @@
"use client"
import { useParams } from "next/navigation"
import { useEffect } from "react"