From 76cf33a199ea4147bd3e3f7499da49a19172c7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Thu, 22 May 2025 15:05:25 +0000 Subject: [PATCH] Merged in fix/tripadvisor-rating (pull request #2193) fix(SW-2892): don't show Tripadvisor rating if undefined * fix: don't show rating if undefined Approved-by: Bianca Widstam Approved-by: Christian Andolf Approved-by: Erik Tiekstra --- .../HotelMapCard/DialogImage/index.tsx | 26 ++++++++++--------- .../DestinationPage/HotelMapCard/index.tsx | 2 +- .../HotelCardDialogImage/index.tsx | 16 +++++++----- .../ListingHotelCardDialog/index.tsx | 2 +- .../StandaloneHotelCardDialog/index.tsx | 2 +- .../hotelReservation/selectHotel/map.ts | 6 ++--- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/DialogImage/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/DialogImage/index.tsx index 860248bfe..06eeabe33 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/DialogImage/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/DialogImage/index.tsx @@ -7,16 +7,16 @@ import Chip from "@/components/TempDesignSystem/Chip" import styles from "./dialogImage.module.css" interface DialogImageProps { - image: string | undefined - altText: string | undefined - ratings: number + image?: string + altText?: string + rating?: number imageError: boolean setImageError: (error: boolean) => void } export default function DialogImage({ image, altText, - ratings, + rating, imageError, setImageError, }: DialogImageProps) { @@ -32,14 +32,16 @@ export default function DialogImage({ onError={() => setImageError(true)} /> )} -
- - - -

{ratings}

-
-
-
+ {rating ? ( +
+ + + + {rating} + + +
+ ) : null} ) } diff --git a/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/index.tsx index 8636717ec..fa60367a1 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/HotelMapCard/index.tsx @@ -68,7 +68,7 @@ export default function HotelMapCard({ diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/HotelCardDialogImage/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/HotelCardDialogImage/index.tsx index 6891039a4..ac2d33b09 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/HotelCardDialogImage/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/HotelCardDialogImage/index.tsx @@ -12,7 +12,7 @@ import type { HotelCardDialogImageProps } from "@/types/components/hotelReservat export default function HotelCardDialogImage({ firstImage, altText, - ratings, + rating, imageError, setImageError, position, @@ -31,12 +31,14 @@ export default function HotelCardDialogImage({ onError={() => setImageError(true)} /> )} -
- - - {ratings} - -
+ {rating ? ( +
+ + + {rating} + +
+ ) : null} ) } diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx index 85d5cfe98..6c8690d39 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx @@ -62,7 +62,7 @@ export default function ListingHotelCardDialog({ void position: "top" | "left"