feat(SW-3151): Added original to imageSchema and added transform to a more generic image type
Approved-by: Bianca Widstam Approved-by: Chuma Mcphoy (We Ahead) Approved-by: Matilda Landström
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import Image from '../../Image'
|
||||
|
||||
import { hotelCardDialogImageVariants } from './variants'
|
||||
import { TripAdvisorChip } from '../../TripAdvisorChip'
|
||||
import { hotelCardDialogImageVariants } from './variants'
|
||||
|
||||
import styles from './hotelCardDialogImage.module.css'
|
||||
import ImageFallback from '../../ImageFallback'
|
||||
|
||||
export type HotelCardDialogImageProps = {
|
||||
firstImage?: string
|
||||
imageSrc?: string
|
||||
altText?: string
|
||||
rating?: { tripAdvisor?: number | null }
|
||||
imageError: boolean
|
||||
@@ -15,7 +15,7 @@ export type HotelCardDialogImageProps = {
|
||||
}
|
||||
|
||||
export function HotelCardDialogImage({
|
||||
firstImage,
|
||||
imageSrc,
|
||||
altText,
|
||||
rating,
|
||||
imageError,
|
||||
@@ -26,11 +26,11 @@ export function HotelCardDialogImage({
|
||||
|
||||
return (
|
||||
<div className={classNames}>
|
||||
{!firstImage || imageError ? (
|
||||
<div className={styles.imagePlaceholder} />
|
||||
{!imageSrc || imageError ? (
|
||||
<ImageFallback />
|
||||
) : (
|
||||
<Image
|
||||
src={firstImage}
|
||||
src={imageSrc}
|
||||
alt={altText || ''}
|
||||
fill
|
||||
onError={() => setImageError(true)}
|
||||
|
||||
Reference in New Issue
Block a user