From 67799a508a1b68e4a77d6545e3aa62b493c51a09 Mon Sep 17 00:00:00 2001 From: k00b Date: Mon, 2 Sep 2024 18:15:04 -0500 Subject: [PATCH] image loading fixes (fixes #1345) --- components/image.js | 2 +- components/text.js | 2 +- components/text.module.css | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/image.js b/components/image.js index 750a90c5..37ad0019 100644 --- a/components/image.js +++ b/components/image.js @@ -57,7 +57,7 @@ function ImageOriginal ({ src, topLevel, rel, tab, children, onClick, ...props } target='_blank' rel={rel ?? UNKNOWN_LINK_REL} href={src} - >{isRawURL ? src : children} + >{isRawURL || !children ? src : children} ) } diff --git a/components/text.js b/components/text.js index 0ae3fdca..d71a9465 100644 --- a/components/text.js +++ b/components/text.js @@ -150,7 +150,7 @@ export default memo(function Text ({ rel, imgproxyUrls, children, tab, itemId, o return url } const srcSet = imgproxyUrls?.[url] - return + return }, [imgproxyUrls, topLevel, tab]) return ( diff --git a/components/text.module.css b/components/text.module.css index f0e4843d..8680b057 100644 --- a/components/text.module.css +++ b/components/text.module.css @@ -129,16 +129,13 @@ } .text img { - --height: 35vh; - --width: 100%; display: block; margin-top: .5rem; margin-bottom: .5rem; - width: auto; - max-width: min(var(--width), 100%); + max-width: 100%; cursor: zoom-in; height: auto; - max-height: min(var(--height), 25vh); + max-height: 25vh; object-fit: contain; object-position: left top; min-width: 50%; @@ -148,7 +145,7 @@ .text img.topLevel { margin-top: .75rem; margin-bottom: .75rem; - max-height: min(var(--height), 35vh); + max-height: 35vh; } img.fullScreen {