From 5ff1e0cd3c076ae95d278bbec00d54c77ee51653 Mon Sep 17 00:00:00 2001 From: Hyko Date: Sun, 26 Apr 2026 19:24:17 -0400 Subject: [PATCH] fix(media): apply fill positioning classes to private image fallback --- src/features/media/components/MediaImage.client.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/media/components/MediaImage.client.js b/src/features/media/components/MediaImage.client.js index e98c784..6e9a24e 100644 --- a/src/features/media/components/MediaImage.client.js +++ b/src/features/media/components/MediaImage.client.js @@ -26,12 +26,17 @@ export default function MediaImage({ const altText = alt ?? media.alt_text ?? media.original_name ?? ''; if (media.visibility !== 'public') { + // En mode `fill`, next/image se positionne en absolute pour remplir le + // parent relatif. On reproduit ce comportement avec `` natif pour que + // les classes utilitaires (object-cover, object-contain) s'appliquent à + // l'image privée comme à la publique. + const fillClass = fill ? 'absolute inset-0 w-full h-full' : ''; // eslint-disable-next-line @next/next/no-img-element return ( {altText} );