From d66cdbd4f86886eef3fb832388b71a9ebc6b265b Mon Sep 17 00:00:00 2001 From: "Md. Tajmirul Islam Akhand" Date: Fri, 14 Mar 2025 05:29:03 +0600 Subject: [PATCH] fix: add classes for picture tag in media component (#11605) Sometimes I need to add some classes to the `picture` tag of Media component. in this case I need to do this: ``` ``` So I added an additional props `pictureClassName` for the picture tag. Now I can do this: ``` ``` NOTE: I've encountered situations where I needed to add classes to the `picture` tag, not just for `w-full h-full`. To handle this, I had to update the Media component. I believe this would be a valuable improvement to the Media component. --- templates/website/src/components/Media/ImageMedia/index.tsx | 3 ++- templates/website/src/components/Media/types.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/website/src/components/Media/ImageMedia/index.tsx b/templates/website/src/components/Media/ImageMedia/index.tsx index 948346ce5..c472254da 100644 --- a/templates/website/src/components/Media/ImageMedia/index.tsx +++ b/templates/website/src/components/Media/ImageMedia/index.tsx @@ -21,6 +21,7 @@ export const ImageMedia: React.FC = (props) => { const { alt: altFromProps, fill, + pictureClassName, imgClassName, priority, resource, @@ -56,7 +57,7 @@ export const ImageMedia: React.FC = (props) => { .join(', ') return ( - + void onLoad?: () => void