Merged in fix/remove-translated-slugs (pull request #1390)
Fix(SW-1467): Remove translation of hotel page sidepeek slugs * fix(SW-1467): remove translation of sidepeek slugs * fix: update enums Approved-by: Erik Tiekstra Approved-by: Fredrik Thorsson
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
import {
|
||||
meetingsAndConferences,
|
||||
restaurantAndBar,
|
||||
wellnessAndExercise,
|
||||
} from "@/constants/routes/hotelPageParams"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import {
|
||||
type Facilities,
|
||||
type FacilityCard,
|
||||
@@ -18,6 +10,8 @@ import {
|
||||
RestaurantHeadings,
|
||||
WellnessHeadings,
|
||||
} from "@/types/components/hotelPage/facilities"
|
||||
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
||||
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
||||
import { FacilityEnum } from "@/types/enums/facilities"
|
||||
import type {
|
||||
Amenities,
|
||||
@@ -77,8 +71,9 @@ export function isFacilityImage(card: FacilityCardType): card is FacilityImage {
|
||||
function setCardProps(
|
||||
theme: CardProps["theme"],
|
||||
buttonText: (typeof FacilityCardButtonText)[keyof typeof FacilityCardButtonText],
|
||||
href: string,
|
||||
href: HotelHashValues,
|
||||
heading: string,
|
||||
slug: SidepeekSlugs,
|
||||
scriptedTopTitle?: string
|
||||
): FacilityCard {
|
||||
return {
|
||||
@@ -87,7 +82,7 @@ function setCardProps(
|
||||
heading,
|
||||
scriptedTopTitle,
|
||||
secondaryButton: {
|
||||
href: `#s-${href}`,
|
||||
href: `#s-${slug}`,
|
||||
title: buttonText,
|
||||
isExternal: false,
|
||||
scrollOnClick: false,
|
||||
@@ -100,8 +95,6 @@ export function setFacilityCardGrids(
|
||||
amenities: Amenities,
|
||||
healthFacilities: HealthFacilities
|
||||
): Facilities {
|
||||
const lang = getLang()
|
||||
|
||||
const cards: Facilities = facilities
|
||||
.filter((fac) => !!fac.headingText)
|
||||
.map((facility) => {
|
||||
@@ -133,8 +126,9 @@ export function setFacilityCardGrids(
|
||||
card = setCardProps(
|
||||
"one",
|
||||
FacilityCardButtonText.WELLNESS,
|
||||
wellnessAndExercise[lang],
|
||||
HotelHashValues.wellness,
|
||||
facility.headingText,
|
||||
SidepeekSlugs.wellness,
|
||||
wellnessTitle
|
||||
)
|
||||
grid.unshift(card)
|
||||
@@ -144,8 +138,9 @@ export function setFacilityCardGrids(
|
||||
card = setCardProps(
|
||||
"primaryDim",
|
||||
FacilityCardButtonText.MEETINGS,
|
||||
meetingsAndConferences[lang],
|
||||
HotelHashValues.meetings,
|
||||
facility.headingText,
|
||||
SidepeekSlugs.meetings,
|
||||
"Events that make an impression"
|
||||
)
|
||||
grid.push(card)
|
||||
@@ -156,8 +151,9 @@ export function setFacilityCardGrids(
|
||||
card = setCardProps(
|
||||
"primaryDark",
|
||||
FacilityCardButtonText.RESTAURANT,
|
||||
restaurantAndBar[lang],
|
||||
HotelHashValues.restaurant,
|
||||
facility.headingText,
|
||||
SidepeekSlugs.restaurant,
|
||||
restaurantTitle
|
||||
)
|
||||
grid.unshift(card)
|
||||
|
||||
Reference in New Issue
Block a user