diff --git a/src/sub-blocks/ImageCard/ImageCard.tsx b/src/sub-blocks/ImageCard/ImageCard.tsx index 7be7fe92b..43964ebce 100644 --- a/src/sub-blocks/ImageCard/ImageCard.tsx +++ b/src/sub-blocks/ImageCard/ImageCard.tsx @@ -80,6 +80,7 @@ const ImageCard = (props: ImageCardProps) => { rel={target === '_blank' ? 'noopener noreferrer' : undefined} className={b({border, 'with-content': hasContent, direction})} title={urlTitle} + style={{backgroundColor}} extraProps={{ draggable: false, onDragStart: (e: React.DragEvent) => e.preventDefault(), diff --git a/src/sub-blocks/ImageCard/__stories__/ImageCard.stories.tsx b/src/sub-blocks/ImageCard/__stories__/ImageCard.stories.tsx index 43a09a5d5..30f4bc444 100644 --- a/src/sub-blocks/ImageCard/__stories__/ImageCard.stories.tsx +++ b/src/sub-blocks/ImageCard/__stories__/ImageCard.stories.tsx @@ -159,6 +159,7 @@ export const DirectionReverse = MultipleTemplate.bind({}); export const Content = ContentTemplate.bind({}); export const BackgroundColor = MultipleTemplate.bind({}); export const WithUrl = MultipleTemplate.bind({}); +export const WithUrlAndBackgroundColor = BorderTemplate.bind({}); export const Border = BorderTemplate.bind({}); export const BorderRadius = BorderRadiusTemplate.bind({}); export const ControlPosition = ControlPositionTemplate.bind({}); @@ -166,6 +167,7 @@ export const ControlPosition = ControlPositionTemplate.bind({}); DirectionReverse.args = {direction: 'reverse'} as Partial; BackgroundColor.args = {...data.backgroundColor.content}; WithUrl.args = {...data.withUrl.content}; +WithUrlAndBackgroundColor.args = {...data.withUrlAndBackgroundColor.content}; ControlPosition.args = undefined; ControlPosition.argTypes = { title: {table: {disable: true}}, diff --git a/src/sub-blocks/ImageCard/__stories__/data.json b/src/sub-blocks/ImageCard/__stories__/data.json index 5f7e6ad47..a546aade5 100644 --- a/src/sub-blocks/ImageCard/__stories__/data.json +++ b/src/sub-blocks/ImageCard/__stories__/data.json @@ -53,6 +53,12 @@ "url": "https://example.com" } }, + "withUrlAndBackgroundColor": { + "content": { + "url": "https://example.com", + "backgroundColor": "#ccf0d2" + } + }, "content": { "url": "https://example.com", "links": [