From 1d8319bfcb89661cf7b02ece3289005ebf3ad27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Tue, 1 Oct 2024 10:57:22 +0200 Subject: [PATCH] fix(SW-302): fixes after rebase --- .../ContentType/HotelPage/Facilities/utils.ts | 35 ------------------- components/ContentType/HotelPage/index.tsx | 2 +- components/TempDesignSystem/Card/index.tsx | 8 +++-- i18n/dictionaries/da.json | 1 - i18n/dictionaries/fi.json | 1 - i18n/dictionaries/no.json | 1 - i18n/dictionaries/sv.json | 1 - server/routers/hotels/query.ts | 2 +- utils/facilityCards.ts | 5 ++- 9 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 components/ContentType/HotelPage/Facilities/utils.ts diff --git a/components/ContentType/HotelPage/Facilities/utils.ts b/components/ContentType/HotelPage/Facilities/utils.ts deleted file mode 100644 index 1086e7430..000000000 --- a/components/ContentType/HotelPage/Facilities/utils.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Facility } from "@/types/components/hotelPage/facilities" -import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage" - -export function setActivityCard(activitiesCard: ActivityCard): Facility { - const hasImage = !!activitiesCard.background_image - return [ - { - id: "activities", - theme: hasImage ? "image" : "primaryDark", - scriptedTopTitle: activitiesCard.scripted_title, - heading: activitiesCard.heading, - bodyText: activitiesCard.body_text, - backgroundImage: hasImage ? activitiesCard.background_image : undefined, - primaryButton: hasImage - ? { - href: activitiesCard.contentPage.href, - title: activitiesCard.cta_text, - isExternal: false, - } - : undefined, - secondaryButton: hasImage - ? undefined - : { - href: activitiesCard.contentPage.href, - title: activitiesCard.cta_text, - isExternal: false, - }, - columnSpan: "three", - }, - ] -} - -export function getCardTheme() { - // TODO -} diff --git a/components/ContentType/HotelPage/index.tsx b/components/ContentType/HotelPage/index.tsx index 9b27a4c12..66b5bb46d 100644 --- a/components/ContentType/HotelPage/index.tsx +++ b/components/ContentType/HotelPage/index.tsx @@ -55,7 +55,7 @@ export default async function HotelPage() { facilityCards, hotelDetailedFacilities ) - activitiesCard && facilities.push(setActivityCard(activitiesCard)) + //activitiesCard && facilities.push(setActivityCard(activitiesCard)) const topThreePois = pointsOfInterest.slice(0, 3) const coordinates = { diff --git a/components/TempDesignSystem/Card/index.tsx b/components/TempDesignSystem/Card/index.tsx index 94cc08773..f3a8f3594 100644 --- a/components/TempDesignSystem/Card/index.tsx +++ b/components/TempDesignSystem/Card/index.tsx @@ -11,6 +11,7 @@ import { cardVariants } from "./variants" import styles from "./card.module.css" +import type { ImageVaultAsset } from "@/types/components/imageVault" import type { CardProps } from "./card" export default function Card({ @@ -30,12 +31,13 @@ export default function Card({ const buttonTheme = getTheme(theme) imageHeight = imageHeight || 320 - imageWidth = + + /*imageWidth = imageWidth || (backgroundImage ? backgroundImage.dimensions.aspectRatio * imageHeight : 420) - +*/ return (
diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 71566409e..21097a538 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -84,7 +84,6 @@ "FAQ": "Ofte stillede spørgsmål", "Failed to delete credit card, please try again later.": "Kunne ikke slette kreditkort. Prøv venligst igen senere.", "Fair": "Messe", - "FAQ": "FAQ", "Find booking": "Find booking", "Find hotels": "Find hotel", "Flexibility": "Fleksibilitet", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 3be690ca0..ab17e3f83 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -84,7 +84,6 @@ "FAQ": "UKK", "Failed to delete credit card, please try again later.": "Luottokortin poistaminen epäonnistui, yritä myöhemmin uudelleen.", "Fair": "Messukeskus", - "FAQ": "FAQ", "Find booking": "Etsi varaus", "Find hotels": "Etsi hotelleja", "Flexibility": "Joustavuus", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index dcd51350b..8bc1eafb2 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -80,7 +80,6 @@ "Explore all levels and benefits": "Utforsk alle nivåer og fordeler", "Explore nearby": "Utforsk i nærheten", "Extras to your booking": "Tilvalg til bestillingen din", - "FAQ": "FAQ", "Failed to delete credit card, please try again later.": "Kunne ikke slette kredittkortet, prøv igjen senere.", "Fair": "Messe", "FAQ": "FAQ", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index d1327d0b7..e1f48b548 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -84,7 +84,6 @@ "FAQ": "FAQ", "Failed to delete credit card, please try again later.": "Det gick inte att ta bort kreditkortet, försök igen senare.", "Fair": "Mässa", - "FAQ": "FAQ", "Find booking": "Hitta bokning", "Find hotels": "Hitta hotell", "Flexibility": "Flexibilitet", diff --git a/server/routers/hotels/query.ts b/server/routers/hotels/query.ts index 08b1c59e5..0fae3ff79 100644 --- a/server/routers/hotels/query.ts +++ b/server/routers/hotels/query.ts @@ -245,7 +245,7 @@ export const hotelQueryRouter = router({ hotelImages: images, pointsOfInterest: hotelAttributes.pointsOfInterest, roomCategories, - activitiesCard: activities, + activitiesCard: activities?.upcoming_activities_card, facilityCards: facilities, } }), diff --git a/utils/facilityCards.ts b/utils/facilityCards.ts index 87893399d..0d6ea64c2 100644 --- a/utils/facilityCards.ts +++ b/utils/facilityCards.ts @@ -74,7 +74,10 @@ async function setCardProps( return card } -export function setFacilityCards(facilities: Facility[], amenities: Amenities) { +export async function setFacilityCards( + facilities: Facility[], + amenities: Amenities +) { const lang = getLang() const cards: Facilities = []