Skip to content

Commit ddad4fc

Browse files
committed
updated loading
1 parent 168aef3 commit ddad4fc

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

src/app/layout.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,22 @@ export default function RootLayout({
149149
},
150150
};
151151

152+
const shellFallback = (
153+
<div className="fixed inset-0 z-80 flex items-center justify-center bg-background px-4">
154+
<div className="w-full max-w-lg border-4 border-black bg-card p-4 shadow-retro-lg sm:p-6">
155+
<p className="font-pixel text-2xl uppercase text-foreground sm:text-3xl">
156+
Muhammad Fiaz
157+
</p>
158+
<p className="mt-2 text-sm font-black uppercase text-muted-foreground sm:text-base">
159+
Loading workspace...
160+
</p>
161+
<div className="mt-5 h-7 border-4 border-black bg-muted p-1 sm:h-8">
162+
<div className="h-full w-full animate-pulse border-2 border-black bg-primary" />
163+
</div>
164+
</div>
165+
</div>
166+
);
167+
152168
return (
153169
<html lang="en" suppressHydrationWarning>
154170
<head>
@@ -166,7 +182,7 @@ export default function RootLayout({
166182
<GoogleTagManager gtmId={gtmId} />
167183
) : null}
168184
{shouldLoadAnalytics && gaId ? <GoogleAnalytics gaId={gaId} /> : null}
169-
<Suspense fallback={null}>
185+
<Suspense fallback={shellFallback}>
170186
<ThemeProvider>
171187
<RouteProgressBar />
172188
<InitialLoader />

src/app/loading.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default function Loading() {
2+
return (
3+
<div className="fixed inset-0 z-80 flex items-center justify-center bg-background px-4">
4+
<div className="w-full max-w-lg border-4 border-black bg-card p-4 shadow-retro-lg sm:p-6">
5+
<p className="font-pixel text-2xl uppercase text-foreground sm:text-3xl">
6+
Muhammad Fiaz
7+
</p>
8+
<p className="mt-2 text-sm font-black uppercase text-muted-foreground sm:text-base">
9+
Booting workspace...
10+
</p>
11+
<div className="mt-5 h-7 border-4 border-black bg-muted p-1 sm:h-8">
12+
<div className="h-full w-full animate-pulse border-2 border-black bg-primary" />
13+
</div>
14+
</div>
15+
</div>
16+
);
17+
}

0 commit comments

Comments
 (0)