-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9485c2a
commit a119d27
Showing
2 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
/* eslint-disable jsx-a11y/alt-text */ | ||
"use client"; | ||
|
||
import cn from "clsx"; | ||
import Image from "next/image"; | ||
import Image, { ImageProps } from "next/image"; | ||
import { useState } from "react"; | ||
|
||
import type { ComponentProps } from "react"; | ||
|
||
export default function BlurImage(props: ComponentProps<typeof Image>) { | ||
const [isLoading, setLoading] = useState(true); | ||
export default function BlurImage({ props }: { props: ImageProps }) { | ||
const [isLoading, setLoading] = useState(true); | ||
|
||
return ( | ||
<Image | ||
{...props} | ||
alt={props.alt} | ||
className={cn( | ||
props.className, | ||
"duration-700 ease-in-out", | ||
isLoading ? "scale-105 blur-lg" : "scale-100 blur-0", | ||
)} | ||
onLoadingComplete={() => setLoading(false)} | ||
/> | ||
); | ||
return ( | ||
<Image | ||
className={cn( | ||
props.className, | ||
"duration-700 ease-in-out", | ||
isLoading ? "scale-105 blur-lg" : "scale-100 blur-0", | ||
)} | ||
onLoadingComplete={() => setLoading(false)} | ||
{...props} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters