fix images not rendering

This commit is contained in:
7w1 committed 2026-03-17 12:41:43 -05:00
1 parent 9ed985a2a8
commit 2a1e4105ac
2 files changed
+18 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix images without explicit dimensions not appearing.
@@ -65,6 +65,7 @@ export const ImageContent = as<'div', ImageContentProps>(
(
{
className,
style,
body,
mimeType,
url,
@@ -122,9 +123,15 @@ export const ImageContent = as<'div', ImageContentProps>(
if (autoPlay) loadSrc();
}, [autoPlay, loadSrc]);
const hasDimensions = typeof info?.w === 'number' && typeof info?.h === 'number';
return (
<Box
className={classNames(css.RelativeBase, className)}
style={{
...(hasDimensions ? { aspectRatio: `${info.w} / ${info.h}` } : { minHeight: '150px' }),
...style,
}}
{...props}
ref={ref}
onPointerEnter={() => setIsHovered(true)}
@@ -185,7 +192,12 @@ export const ImageContent = as<'div', ImageContentProps>(
</Box>
)}
{srcState.status === AsyncStatus.Success && (
<Box className={classNames(css.AbsoluteContainer, blurred && css.Blur)}>
<Box
className={classNames(
hasDimensions ? css.AbsoluteContainer : undefined,
blurred && css.Blur
)}
>
{renderImage({
alt: body,
title: body,