Skip to content

Commit

Permalink
Merge pull request #118 from PEC-CSS/bug/loader-shifts-content
Browse files Browse the repository at this point in the history
  • Loading branch information
harshjohar authored Nov 5, 2023
2 parents 622f443 + a7247f8 commit b58ac24
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import React from "react";
import { LinearProgress } from "@mui/material";
import { SessionProvider } from "next-auth/react";
import zIndex from "@mui/material/styles/zIndex";

const font = Josefin_Sans({
preload: false,
Expand Down Expand Up @@ -33,7 +34,20 @@ function App({ Component, pageProps: { session, ...pageProps } }: AppProps) {
return (
<SessionProvider session={session}>
<main className={font.className} style={{ position: "relative" }}>
{isLoading ? <LinearProgress /> : null}
{isLoading && (
<div
style={{
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 999, // Set a high z-index to overlay on top
}}
>
<LinearProgress />
</div>
)}
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down

0 comments on commit b58ac24

Please sign in to comment.