fix(blog): add matching loading skeletons
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { DetailPageLoading } from "@/components/page-loading";
|
import { BlogDetailPageLoading } from "@/components/page-loading";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <DetailPageLoading />;
|
return <BlogDetailPageLoading />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ListingPageLoading } from "@/components/page-loading";
|
import { BlogListingPageLoading } from "@/components/page-loading";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <ListingPageLoading />;
|
return <BlogListingPageLoading />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,136 @@
|
|||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
|
|
||||||
|
export function BlogCardsSkeleton({ count = 6 }: { count?: number }) {
|
||||||
|
return (
|
||||||
|
<div className="grid gap-6 md:grid-cols-2 2xl:grid-cols-3" aria-hidden="true">
|
||||||
|
{Array.from({ length: count }).map((_, index) => (
|
||||||
|
<div
|
||||||
|
key={index}
|
||||||
|
className="overflow-hidden rounded-[2rem] border border-border/70 bg-card/85 shadow-sm"
|
||||||
|
>
|
||||||
|
<Skeleton className="aspect-[16/10] w-full rounded-t-[2rem] rounded-b-none" />
|
||||||
|
<div className="space-y-4 p-5">
|
||||||
|
<Skeleton className="h-7 w-11/12" />
|
||||||
|
<Skeleton className="h-7 w-3/4" />
|
||||||
|
<div className="space-y-2 pt-1">
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-10/12" />
|
||||||
|
<Skeleton className="h-4 w-8/12" />
|
||||||
|
</div>
|
||||||
|
<Skeleton className="h-4 w-28" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function BlogListingPageLoading() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-[linear-gradient(180deg,hsl(var(--background)),hsl(var(--muted)/0.32))]" dir="rtl">
|
||||||
|
<div className="container mx-auto px-4 py-10">
|
||||||
|
<Skeleton className="mb-8 aspect-[5/1.25] w-full rounded-[2rem] md:aspect-[6/1.25]" />
|
||||||
|
|
||||||
|
<div className="mb-8 flex flex-col gap-5 md:flex-row md:items-end md:justify-between">
|
||||||
|
<div className="space-y-3 text-right">
|
||||||
|
<Skeleton className="h-5 w-36" />
|
||||||
|
<Skeleton className="h-11 w-28" />
|
||||||
|
<Skeleton className="h-5 w-full max-w-xl" />
|
||||||
|
<Skeleton className="h-5 w-10/12 max-w-lg" />
|
||||||
|
</div>
|
||||||
|
<div className="flex w-full max-w-md items-center gap-2">
|
||||||
|
<Skeleton className="h-12 flex-1 rounded-2xl" />
|
||||||
|
<Skeleton className="h-12 w-12 rounded-2xl xl:hidden" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-8 xl:grid-cols-[18rem_minmax(0,1fr)] xl:items-start">
|
||||||
|
<aside className="hidden xl:block">
|
||||||
|
<div className="sticky top-24 space-y-4 rounded-[2rem] border border-border/70 bg-card/80 p-4 shadow-sm">
|
||||||
|
<Skeleton className="h-7 w-32" />
|
||||||
|
<Skeleton className="h-32 w-full rounded-3xl" />
|
||||||
|
<Skeleton className="h-28 w-full rounded-3xl" />
|
||||||
|
<Skeleton className="h-40 w-full rounded-3xl" />
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<BlogCardsSkeleton />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function BlogDetailPageLoading() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-[linear-gradient(180deg,hsl(var(--background)),hsl(var(--muted)/0.28))]" dir="rtl">
|
||||||
|
<div className="container mx-auto px-4 py-8">
|
||||||
|
<div className="gap-8 xl:flex xl:items-start">
|
||||||
|
<aside className="sticky top-24 hidden w-72 shrink-0 xl:block">
|
||||||
|
<div className="rounded-[1.75rem] border border-border/70 bg-card/90 p-4 shadow-sm">
|
||||||
|
<Skeleton className="mb-4 h-6 w-36" />
|
||||||
|
<div className="space-y-3">
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-10/12" />
|
||||||
|
<Skeleton className="h-4 w-8/12" />
|
||||||
|
<Skeleton className="h-4 w-9/12" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main className="min-w-0 flex-1">
|
||||||
|
<article className="overflow-hidden rounded-[2.5rem] border border-border/70 bg-card/95">
|
||||||
|
<header className="space-y-6 p-5 md:p-8">
|
||||||
|
<Skeleton className="h-5 w-64" />
|
||||||
|
<div className="space-y-4">
|
||||||
|
<Skeleton className="h-12 w-11/12" />
|
||||||
|
<Skeleton className="h-12 w-8/12" />
|
||||||
|
<Skeleton className="h-5 w-full max-w-3xl" />
|
||||||
|
<Skeleton className="h-5 w-10/12 max-w-2xl" />
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-wrap gap-3">
|
||||||
|
<Skeleton className="h-8 w-28 rounded-full" />
|
||||||
|
<Skeleton className="h-8 w-36 rounded-full" />
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className="px-5 md:px-8">
|
||||||
|
<Skeleton className="aspect-[16/9] w-full rounded-[2rem]" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-5 p-5 md:p-8 xl:hidden">
|
||||||
|
<Skeleton className="h-32 w-full rounded-[1.5rem]" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-8 px-5 pb-8 pt-6 md:px-8 md:pb-10">
|
||||||
|
<div className="mx-auto max-w-4xl space-y-4">
|
||||||
|
<Skeleton className="h-8 w-7/12" />
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-11/12" />
|
||||||
|
<Skeleton className="h-4 w-9/12" />
|
||||||
|
<Skeleton className="mt-8 h-8 w-6/12" />
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-10/12" />
|
||||||
|
</div>
|
||||||
|
<div className="mx-auto flex max-w-4xl flex-wrap gap-2">
|
||||||
|
<Skeleton className="h-8 w-20 rounded-full" />
|
||||||
|
<Skeleton className="h-8 w-24 rounded-full" />
|
||||||
|
<Skeleton className="h-8 w-16 rounded-full" />
|
||||||
|
</div>
|
||||||
|
<Skeleton className="mx-auto h-12 w-full max-w-4xl rounded-2xl" />
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<Skeleton className="mt-8 h-48 w-full rounded-[2rem]" />
|
||||||
|
<Skeleton className="mt-10 h-56 w-full rounded-[2rem]" />
|
||||||
|
<Skeleton className="mt-10 h-72 w-full rounded-[2rem]" />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function ListingPageLoading() {
|
export function ListingPageLoading() {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-background" dir="rtl">
|
<div className="min-h-screen bg-background" dir="rtl">
|
||||||
|
|||||||
Reference in New Issue
Block a user