feat(SW-495): set scripted top title as optional
This commit is contained in:
@@ -34,7 +34,7 @@ function setCardProps(
|
||||
heading: string,
|
||||
buttonText: string,
|
||||
href: string,
|
||||
scriptedTopTitle: string
|
||||
scriptedTopTitle?: string
|
||||
): FacilityCard {
|
||||
return {
|
||||
theme,
|
||||
@@ -142,7 +142,7 @@ export function getRestaurantHeading(amenities: Amenities): RestaurantHeadings {
|
||||
|
||||
export function getWellnessHeading(
|
||||
healthFacilities: HealthFacilities
|
||||
): WellnessHeadings {
|
||||
): WellnessHeadings | undefined {
|
||||
const hasGym = healthFacilities.some(
|
||||
(facility) => facility.type === HealthFacilitiesEnum.Gym
|
||||
)
|
||||
@@ -155,8 +155,10 @@ export function getWellnessHeading(
|
||||
const hasJacuzzi = healthFacilities.some(
|
||||
(facility) => facility.type === HealthFacilitiesEnum.Jacuzzi
|
||||
)
|
||||
const hasPool = healthFacilities.some((facility) =>
|
||||
facility.type.includes("Pool")
|
||||
const hasPool = healthFacilities.some(
|
||||
(facility) =>
|
||||
facility.type === HealthFacilitiesEnum.IndoorPool ||
|
||||
facility.type === HealthFacilitiesEnum.OutdoorPool
|
||||
)
|
||||
|
||||
if (hasGym && hasJacuzzi && hasSauna && hasRelax) {
|
||||
@@ -168,7 +170,6 @@ export function getWellnessHeading(
|
||||
} else if (hasGym && hasPool) {
|
||||
return WellnessHeadings.GymPool
|
||||
}
|
||||
return WellnessHeadings.FallbackHeading
|
||||
}
|
||||
|
||||
export function filterFacilityCards(cards: FacilityGrid) {
|
||||
|
||||
Reference in New Issue
Block a user