From dfd959fbcd3ee97ec927a7b456078ca576757da3 Mon Sep 17 00:00:00 2001 From: Sam Grund Date: Tue, 10 Dec 2024 11:39:15 -0500 Subject: [PATCH] feat(objecttile): L3-4753 accept srcset & sizes from object tile (#447) Co-authored-by: Sam Grund --- src/patterns/ObjectTile/ObjectTile.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/patterns/ObjectTile/ObjectTile.tsx b/src/patterns/ObjectTile/ObjectTile.tsx index fbc75608..83963a47 100644 --- a/src/patterns/ObjectTile/ObjectTile.tsx +++ b/src/patterns/ObjectTile/ObjectTile.tsx @@ -36,6 +36,14 @@ export interface ObjectTileProps extends ComponentProps<'a'> { * Image URL for the object. */ imageUrl?: string; + /** + * Image srcset for the object. [https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset] + */ + imageSrcSet?: string; + /** + * Image sizes for the object. [https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes] + */ + imageSizes?: string; /** * Object Lot number. */ @@ -82,6 +90,8 @@ const ObjectTile = forwardRef( favoriteElement: FavoriteElement, imageAlt = 'Brought to you by Phillips', imageUrl = '', + imageSrcSet, + imageSizes, lotNumber, makerText, modelText, @@ -102,6 +112,8 @@ const ObjectTile = forwardRef( className={`${baseClassName}__img`} objectFit="cover" src={imageUrl} + srcSet={imageSrcSet} + sizes={imageSizes} /> {!withdrawnText ? (