-
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.
feat: Add delay to lazy load and use skeleton animation
Signed-off-by: Ho <[email protected]>
- Loading branch information
Ho
committed
May 24, 2024
1 parent
3b92a45
commit a25fca4
Showing
3 changed files
with
66 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Skeleton } from '@/components/ui/skeleton'; | ||
|
||
export function SkeletonCard() { | ||
return ( | ||
<div className="flex flex-col space-y-3"> | ||
<Skeleton className="h-[125px] w-[250px] rounded-xl" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function SkeletonContact() { | ||
return ( | ||
<div className="flex items-center space-x-4"> | ||
<Skeleton className="h-12 w-12 rounded-full" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function SkeletonText() { | ||
return ( | ||
<div className="flex flex-col space-y-3"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
); | ||
} | ||
|
||
export function SkeletonShortText() { | ||
return ( | ||
<div className='inline-block align-middle'> | ||
<Skeleton className="h-4 w-[50px]" /> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { cn } from "@/lib/utils" | ||
|
||
function Skeleton({ | ||
className, | ||
...props | ||
}) { | ||
return (<div className={cn("animate-pulse rounded-md bg-muted", className)} {...props} />); | ||
} | ||
|
||
export { Skeleton } |