Skip to content

Commit

Permalink
Add loading bar
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardozgz committed Oct 20, 2024
1 parent e826f15 commit a903b21
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 22 deletions.
1 change: 1 addition & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"lodash": "^4.17.21",
"lucide-react": "^0.314.0",
"next": "^14.2.1",
"next-nprogress-bar": "^2.3.14",
"node-loader": "^2.0.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
Expand Down
19 changes: 19 additions & 0 deletions apps/website/src/app/components/ProgressBarProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client';

import { AppProgressBar as ProgressBar } from 'next-nprogress-bar';

const ProgressBarProvider = ({ children }: { children: React.ReactNode }) => {
return (
<>
<ProgressBar
height="3px"
color="#d5510d"
options={{ showSpinner: false }}
shallowRouting
/>
{children}
</>
);
};

export default ProgressBarProvider;
5 changes: 4 additions & 1 deletion apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Inter } from "next/font/google";
import { I18nProvider } from "~/i18n/client";
import { TRPCReactProvider } from "~/trpc/react";
import NavBar from "./components/NavBar";
import ProgressBarProvider from "./components/ProgressBarProvider";

const inter = Inter({
subsets: ["latin"],
Expand All @@ -29,7 +30,9 @@ export default function RootLayout({
<I18nProvider>
<TRPCReactProvider>
<NavBar />
{children}
<ProgressBarProvider>
{children}
</ProgressBarProvider>
</TRPCReactProvider>
</I18nProvider>
</body>
Expand Down
57 changes: 36 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a903b21

Please sign in to comment.