diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-12 16:09:21 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-12 16:09:21 +0200 |
| commit | 27ff3104aabed240470d351bda02095d8169501f (patch) | |
| tree | e4b43947c1150201067d40622b52b65bd19f01a2 /src/components/molecules/images | |
| parent | ff3a251e75fafce7d95177010401483127973313 (diff) | |
chore: add a Summary component
Diffstat (limited to 'src/components/molecules/images')
| -rw-r--r-- | src/components/molecules/images/responsive-image.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/molecules/images/responsive-image.tsx b/src/components/molecules/images/responsive-image.tsx index 9f96f18..3d54e95 100644 --- a/src/components/molecules/images/responsive-image.tsx +++ b/src/components/molecules/images/responsive-image.tsx @@ -13,6 +13,10 @@ type ResponsiveImageProps = Omit<ImageProps, 'alt' | 'width' | 'height'> & { */ caption?: string; /** + * Set additional classnames to the figure wrapper. + */ + className?: string; + /** * The image height. */ height: number | string; @@ -34,16 +38,22 @@ type ResponsiveImageProps = Omit<ImageProps, 'alt' | 'width' | 'height'> & { const ResponsiveImage: VFC<ResponsiveImageProps> = ({ alt, caption, + className = '', layout, objectFit, target, ...props }) => { return ( - <figure className={styles.wrapper}> + <figure className={`${styles.wrapper} ${className}`}> {target ? ( <Link href={target} className={styles.link}> - <Image alt={alt} layout={layout || 'intrinsic'} {...props} /> + <Image + alt={alt} + layout={layout || 'intrinsic'} + objectFit={objectFit || 'contain'} + {...props} + /> {caption && ( <figcaption className={styles.caption}>{caption}</figcaption> )} |
