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
This commit is contained in:
@@ -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)}
|
||||
/>
|
||||
)}
|
||||
<div className={styles.tripAdvisor}>
|
||||
<Chip className={styles.tripAdvisor}>
|
||||
<TripadvisorIcon color="Icon/Interactive/Default" />
|
||||
<Typography variant="Tag/sm">
|
||||
<p>{ratings}</p>
|
||||
</Typography>
|
||||
</Chip>
|
||||
</div>
|
||||
{rating ? (
|
||||
<div className={styles.tripAdvisor}>
|
||||
<Chip className={styles.tripAdvisor}>
|
||||
<TripadvisorIcon color="Icon/Interactive/Default" />
|
||||
<Typography variant="Tag/sm">
|
||||
<span>{rating}</span>
|
||||
</Typography>
|
||||
</Chip>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export default function HotelMapCard({
|
||||
<DialogImage
|
||||
image={image.src}
|
||||
altText={image.alt}
|
||||
ratings={tripadvisorRating || 0}
|
||||
rating={tripadvisorRating}
|
||||
imageError={imageError}
|
||||
setImageError={setImageError}
|
||||
/>
|
||||
|
||||
@@ -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)}
|
||||
/>
|
||||
)}
|
||||
<div className={styles.tripAdvisor}>
|
||||
<Chip className={styles.tripAdvisor}>
|
||||
<TripadvisorIcon color="Icon/Interactive/Default" />
|
||||
{ratings}
|
||||
</Chip>
|
||||
</div>
|
||||
{rating ? (
|
||||
<div className={styles.tripAdvisor}>
|
||||
<Chip className={styles.tripAdvisor}>
|
||||
<TripadvisorIcon color="Icon/Interactive/Default" />
|
||||
{rating}
|
||||
</Chip>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function ListingHotelCardDialog({
|
||||
<HotelCardDialogImage
|
||||
firstImage={firstImage}
|
||||
altText={altText}
|
||||
ratings={ratings || 0}
|
||||
rating={ratings}
|
||||
imageError={imageError}
|
||||
setImageError={setImageError}
|
||||
position="top"
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function StandaloneHotelCardDialog({
|
||||
<HotelCardDialogImage
|
||||
firstImage={firstImage}
|
||||
altText={altText}
|
||||
ratings={ratings || 0}
|
||||
rating={ratings}
|
||||
imageError={imageError}
|
||||
setImageError={setImageError}
|
||||
position="left"
|
||||
|
||||
@@ -62,9 +62,9 @@ export interface HotelCardDialogProps {
|
||||
}
|
||||
|
||||
export interface HotelCardDialogImageProps {
|
||||
firstImage: string | undefined
|
||||
altText: string | undefined
|
||||
ratings: number
|
||||
firstImage?: string
|
||||
altText?: string
|
||||
rating?: number | null
|
||||
imageError: boolean
|
||||
setImageError: (error: boolean) => void
|
||||
position: "top" | "left"
|
||||
|
||||
Reference in New Issue
Block a user