feat(BOOK-462): Hiding chatbot on german hotels with Dialogshift widget
Approved-by: Linus Flood
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user