perf: lazy-load avatars and message images (#1517)

Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Tyler
2026-07-06 10:25:54 -04:00
committed by GitHub
parent 74a30c3de8
commit d09d7dea55
2 changed files with 4 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ const AvatarImage = React.forwardRef<
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square h-full w-full", className)}
decoding="async"
loading="lazy"
{...props}
/>
));

View File

@@ -1494,7 +1494,9 @@ function ImageBlock({ alt, dim, resolvedSrc, src }: ImageBlockProps) {
alt={alt}
className="block h-auto max-h-64 max-w-[min(24rem,100%)] rounded-2xl object-contain"
data-spoiler-media-size={hiddenSpoilerMediaSize ? "" : undefined}
decoding="async"
height={intrinsicDimensions.height}
loading="lazy"
ref={imageRef}
src={resolvedSrc}
style={spoilerMediaStyle}