Skip to content

Commit

Permalink
feat: add innerClassName prop to ImageCard component (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
cade-exygy authored Nov 17, 2023
1 parent f94a391 commit 8d2c3ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/blocks/ImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export interface ImageCardProps {
statuses?: StatusBarType[]
/** A list of image tags, a Tag component is rendered for each over the image */
tags?: ImageTag[]
/** When defined, add passed className to the innerClasses array */
innerClassName?: string
/** When true, close button will be placed inside content section on desktop */
modalCloseInContent?: boolean
/** The label text of the close button when the gallery modal is displayed */
Expand Down Expand Up @@ -102,6 +104,9 @@ const ImageCard = (props: ImageCardProps) => {
innerClasses.push(`has-${props.images.length}-images`)
}
}
if (props.innerClassName) {
innerClasses.push(props.innerClassName)
}

const displayedImages = useMemo(() => {
return props.images?.slice(0, 3)
Expand Down

0 comments on commit 8d2c3ff

Please sign in to comment.