From b1b1ed0f3f7b7e40fbc053d55f5d1d40124a3c0e Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 1 Aug 2023 14:26:22 +0800 Subject: [PATCH] Adjustments to prevent layout shift --- src/components/media.jsx | 5 +++-- src/components/status.css | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/media.jsx b/src/components/media.jsx index ffd3f3ca..9c688572 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -121,6 +121,7 @@ function Media({ media, to, showOriginal, autoAnimate, onClick = () => {} }) { '--height': `${height}px`, aspectRatio: `${width} / ${height}`, }; + const fixedWidth = width > height * 2; if (isImage) { // Note: type: unknown might not have width/height @@ -142,7 +143,7 @@ function Media({ media, to, showOriginal, autoAnimate, onClick = () => {} }) { return ( {} }) {