fix(BOOK-468): Added inert attribute to SidePeekSEO element to ignore tab navigation and screen readers

Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-11-24 14:12:10 +00:00
parent acb50eb75e
commit 091c1c3780
6 changed files with 23 additions and 19 deletions

View File

@@ -2,6 +2,8 @@ import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
import SidePeek from "@scandic-hotels/design-system/SidePeek"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { env } from "@/env/server"
import { getIntl } from "@/i18n"
import { appendSlugToPathname } from "@/utils/appendSlugToPathname"
@@ -21,6 +23,7 @@ export default async function MeetingsAndConferencesSidePeek({
heading,
}: MeetingsAndConferencesSidePeekProps) {
const intl = await getIntl()
const shouldInert = env.SEO_INERT
const { seatingText, roomText } = await getConferenceRoomTexts(meetingRooms)
const visibleImages = meetingFacilities?.heroImages.slice(0, 2)
const meetingPageHref = await appendSlugToPathname(meetingPageUrl)
@@ -33,6 +36,7 @@ export default async function MeetingsAndConferencesSidePeek({
id: "common.close",
defaultMessage: "Close",
})}
shouldInert={shouldInert}
>
<div className={styles.wrapper}>
<Typography variant="Title/Subtitle/lg">

View File

@@ -107,6 +107,11 @@ export const env = createEnv({
// transform to boolean
.transform((s) => s === "true")
.default("false"),
SEO_INERT: z
.string()
.refine((s) => s === "1" || s === "0")
.transform((s) => s === "1")
.default("0"),
},
emptyStringAsUndefined: true,
runtimeEnv: {
@@ -162,5 +167,6 @@ export const env = createEnv({
HOTEL_BRANDING: process.env.HOTEL_BRANDING,
CHATBOT_LIVE_LANGS: process.env.CHATBOT_LIVE_LANGS,
NEW_STAYS_ON_MY_PAGES: process.env.NEW_STAYS_ON_MY_PAGES,
SEO_INERT: process.env.SEO_INERT,
},
})