Skip to content

Commit

Permalink
fix: image blurhash out when image loaded
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Jan 2, 2025
1 parent 045d6c7 commit 5b237ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/renderer/src/components/ui/media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ const MediaImpl: FC<MediaProps> = ({
}}
>
{props.blurhash && (
<span className="absolute inset-0 overflow-hidden rounded">
<span
className={cn(
"absolute inset-0 overflow-hidden rounded",
mediaLoadState === "loaded" && "animate-out fade-out-0 fill-mode-forwards",
)}
>
<BlurhashCanvas hash={props.blurhash} className="size-full" />
</span>
)}
Expand All @@ -299,7 +304,10 @@ const MediaImpl: FC<MediaProps> = ({
fitContent={fitContent}
>
<div
className="absolute inset-0 flex items-center justify-center overflow-hidden rounded"
className={cn(
"absolute inset-0 flex items-center justify-center overflow-hidden rounded",
mediaLoadState === "loaded" && "animate-out fade-out-0 fill-mode-forwards",
)}
data-blurhash={blurhash}
>
{blurhash ? (
Expand Down

0 comments on commit 5b237ca

Please sign in to comment.