Skip to content

Commit 8973703

Browse files
author
Alex Patterson
committed
add top loader
1 parent 59feb3b commit 8973703

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎app/(main)/layout.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { draftMode } from "next/headers";
99
import { JSX, SVGProps, Suspense } from "react";
1010

1111
import AlertBanner from "@/components/alert-banner";
12-
12+
import NextTopLoader from 'nextjs-toploader';
1313
import type { SettingsQueryResult } from "@/sanity.types";
1414
import * as demo from "@/sanity/lib/demo";
1515
import { sanityFetch } from "@/sanity/lib/fetch";
@@ -94,7 +94,7 @@ export default async function RootLayout({
9494
disableTransitionOnChange
9595
>
9696
{draftMode().isEnabled && <AlertBanner />}
97-
97+
<NextTopLoader color="hsl(var(--primary))" />
9898
<section className="flex flex-col min-h-[100dvh]">
9999
<header className="fixed left-0 right-0 z-40 flex items-center justify-between px-6 py-4 shadow-md bg-background">
100100
<div className="flex items-center gap-4">
@@ -125,7 +125,6 @@ export default async function RootLayout({
125125
</Sheet>
126126
</div>
127127
</header>
128-
129128
<main className="mt-20">{children}</main>
130129
<Toaster />
131130
<Suspense>

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"next-cloudinary": "^6.6.2",
8282
"next-sanity": "^9.3.10",
8383
"next-themes": "^0.3.0",
84+
"nextjs-toploader": "^1.6.12",
8485
"postcss": "^8.4.38",
8586
"react": "^18.3.1",
8687
"react-cookie": "^7.1.4",

‎pnpm-lock.yaml‎

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)