Skip to content

Commit 8e0f572

Browse files
author
Boopathi
committed
feat: add PageLoader component and use as Suspense fallback on main page
1 parent bb75c64 commit 8e0f572

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/app/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Suspense } from "react";
22
import MainView from "@/components/views/main-view";
3+
import PageLoader from "@/components/layout/page-loader";
34

45
export default function Home() {
56
return (
6-
<Suspense fallback={<div>Loading...</div>}>
7+
<Suspense fallback={<PageLoader />}>
78
<MainView />
89
</Suspense>
910
);
10-
}
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Loader2 } from 'lucide-react';
2+
import Image from 'next/image';
3+
4+
const PageLoader = () => {
5+
return (
6+
<div className="flex flex-col items-center justify-center min-h-screen bg-background">
7+
<div className="flex items-center gap-4 text-2xl font-headline text-primary mb-6" style={{ color: '#facc15' }}>
8+
<Image src="/logo.png" alt="Hustloop Logo" width={50} height={50} className="h-12 w-12 animate-pulse" />
9+
<span>
10+
hustl<strong className="text-3xl align-middle font-bold"></strong>p
11+
</span>
12+
</div>
13+
<Loader2 className="h-8 w-8 animate-spin text-primary" />
14+
<p className="mt-4 text-muted-foreground">Initializing...</p>
15+
</div>
16+
);
17+
};
18+
19+
export default PageLoader;

0 commit comments

Comments
 (0)