Skip to content

Commit 7667b37

Browse files
committed
fix: Prevent home page skeleton from covering the whole page
1 parent c30fc42 commit 7667b37

1 file changed

Lines changed: 58 additions & 2 deletions

File tree

app/page.tsx

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { Metadata } from "next";
22
import { Suspense } from "react";
3-
import { DashboardSkeleton } from "@/components/skeletons";
3+
import { AppFooter } from "@/components/app-footer";
4+
import { AppHeader } from "@/components/app-header";
45
import { HomePageClient } from "@/components/home-page-client";
6+
import { Skeleton } from "@/components/ui/skeleton";
57
import { JsonLd } from "@/components/seo/json-ld";
68
import { toAbsoluteUrl } from "@/lib/seo";
79

@@ -63,11 +65,65 @@ const softwareSchema = {
6365
},
6466
};
6567

68+
function HomePageFallback() {
69+
return (
70+
<main className="flex min-h-screen flex-col">
71+
<AppHeader />
72+
73+
<div className="w-full flex-1 max-w-6xl mx-auto px-4 py-10 space-y-6">
74+
<div className="rounded-2xl border border-border bg-card/90 p-6 shadow-lg backdrop-blur">
75+
<div className="space-y-4 pb-4">
76+
<Skeleton className="h-3 w-32 rounded-full" />
77+
<Skeleton className="h-8 w-64 rounded-lg" />
78+
<Skeleton className="h-4 w-full max-w-md rounded-lg" />
79+
</div>
80+
81+
<div className="space-y-5">
82+
<div className="grid gap-3 md:grid-cols-2">
83+
<div className="space-y-1.5">
84+
<Skeleton className="h-3 w-24 rounded-full" />
85+
<Skeleton className="h-11 rounded-lg" />
86+
</div>
87+
<div className="space-y-1.5">
88+
<Skeleton className="h-3 w-24 rounded-full" />
89+
<Skeleton className="h-11 rounded-lg" />
90+
</div>
91+
</div>
92+
93+
<div className="space-y-2">
94+
<Skeleton className="h-4 w-36 rounded-full" />
95+
<div className="flex flex-wrap gap-2">
96+
{Array.from({ length: 8 }).map((_, index) => (
97+
<Skeleton key={index} className="h-7 w-20 rounded-full" />
98+
))}
99+
</div>
100+
</div>
101+
102+
<div className="flex justify-end gap-3">
103+
<Skeleton className="h-10 w-40 rounded-lg" />
104+
<Skeleton className="h-10 w-10 rounded-lg" />
105+
<Skeleton className="h-10 w-10 rounded-lg" />
106+
</div>
107+
</div>
108+
</div>
109+
110+
<div className="flex flex-col items-center justify-center gap-4 py-20 text-center">
111+
<Skeleton className="h-24 w-24 rounded-full sm:h-32 sm:w-32" />
112+
<Skeleton className="h-6 w-64 rounded-lg" />
113+
<Skeleton className="h-4 w-72 rounded-lg" />
114+
</div>
115+
</div>
116+
117+
<AppFooter />
118+
</main>
119+
);
120+
}
121+
66122
export default function HomePage() {
67123
return (
68124
<>
69125
<JsonLd data={[websiteSchema, softwareSchema]} />
70-
<Suspense fallback={<DashboardSkeleton />}>
126+
<Suspense fallback={<HomePageFallback />}>
71127
<HomePageClient />
72128
</Suspense>
73129
</>

0 commit comments

Comments
 (0)