Skip to content

Commit 516ec5f

Browse files
committed
fix: update loading spinner placeholder and adjust image visibility styles
1 parent 612ca02 commit 516ec5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/webapp/src/components/chat/bubbles/ImageBubble.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function ImageBubble({
107107
</div>
108108
) : (
109109
<>
110-
{/* Spinner overlay while loading */}
110+
{/* Spinner placeholder while image is loading */}
111111
{!loaded && (
112112
<div className="flex h-48 w-[280px] items-center justify-center rounded-[4px] bg-muted">
113113
<svg
@@ -129,7 +129,9 @@ export function ImageBubble({
129129
loading="lazy"
130130
onLoad={() => setLoaded(true)}
131131
onError={handleError}
132-
className={`block max-h-72 max-w-[280px] cursor-zoom-in rounded-[4px] object-cover${loaded ? "" : " hidden"}`}
132+
className={loaded
133+
? "block max-h-72 max-w-[280px] cursor-zoom-in rounded-[4px] object-cover"
134+
: "absolute h-0 w-0 opacity-0 overflow-hidden"}
133135
/>
134136
</DialogTrigger>
135137
<DialogContent className="max-w-4xl bg-black/95 p-2" aria-describedby={undefined}>

0 commit comments

Comments
 (0)