feat(BOOK-462): Hiding chatbot on german hotels with Dialogshift widget

Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-10-20 10:43:08 +00:00
parent 3e3a7fc423
commit 3257054474
2 changed files with 23 additions and 0 deletions

View File

@@ -15,4 +15,16 @@ export const CHATBOT_SHOW_ROUTES = {
export const CHATBOT_HIDE_CONDITIONS = {
searchParams: [{ key: "view", value: "map" }],
routes: {
[Lang.en]: [
"/hotels/scandic-berlin-potsdamer-platz",
"/hotels/scandic-berlin-kurfurstendamm",
"/hotels/scandic-hamburg-emporio",
],
[Lang.sv]: [],
[Lang.no]: [],
[Lang.fi]: [],
[Lang.da]: [],
[Lang.de]: [],
},
} as const

View File

@@ -26,6 +26,17 @@ export function shouldShowChatbot(
return false
}
const isOnHideRoute = CHATBOT_HIDE_CONDITIONS.routes[lang].some((route) => {
const fullRoute = removeTrailingSlash(
removeMultipleSlashes(`/${lang}${route}`)
)
return cleanPathname === fullRoute
})
if (isOnHideRoute) {
return false
}
if (searchParams) {
const shouldHideOnSearchParams = CHATBOT_HIDE_CONDITIONS.searchParams.some(
({ key, value }) => {