-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7fe8d9
commit fe7c69a
Showing
3 changed files
with
74 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,31 @@ | ||
import "../globals.css"; | ||
import type { Metadata } from "next"; | ||
import { Inter } from "next/font/google"; | ||
import { ToggleProvider } from "@/contextProviders/ToggleProvider"; | ||
import NextAuthProvider from "@/contextProviders/sessionProvider"; | ||
import { Toaster } from "react-hot-toast"; | ||
import Sidebar from "@/components/Sidebar"; | ||
import MainContent from "@/components/MainContent"; | ||
import { Providers } from "@/store/provider"; | ||
import { Suspense } from "react"; | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export const metadata: Metadata = { | ||
title: "TPC Portal", | ||
description: "Generated by create next app", | ||
}; | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
} | ||
|
||
const AuthLayout = async ({ children }: Props) => { | ||
const className = inter.className; | ||
|
||
const RouteLayout = async ({ children }: Props) => { | ||
return ( | ||
<html lang="en"> | ||
<body className={className}> | ||
<ToggleProvider> | ||
<div className="flex flex-col h-screen"> | ||
<Toaster /> | ||
|
||
<NextAuthProvider> | ||
<div className="flex-auto flex h-[92vh] "> | ||
{/* sidebar and main content share this space */} | ||
<Suspense fallback={<>Loading...</>}></Suspense> | ||
<Providers> | ||
<div className="w-screen min-h-screen h-max bg-[url(/images/iiti_bg.JPG)] bg-cover bg-fixed bg-center bg-no-repeat absolute"> | ||
<div className="w-full min-h-full h-max bg-gradient-to-b from-black/40 to-black/90 bg-opacity-50 absolute"> | ||
{children} | ||
</div> | ||
</div> | ||
</Providers> | ||
<div className="flex-auto flex h-[92vh] "> | ||
<Providers> | ||
<div className="flex-auto flex h-[92vh] "> | ||
{/* sidebar and main content share this space */} | ||
<Suspense fallback={<>Loading...</>}></Suspense> | ||
<Providers> | ||
<div className="w-screen min-h-screen h-max bg-[url(/images/iiti_bg.JPG)] bg-cover bg-fixed bg-center bg-no-repeat absolute"> | ||
<div className="w-full min-h-full h-max bg-gradient-to-b from-black/40 to-black/90 bg-opacity-50 absolute"> | ||
{children} | ||
</div> | ||
</NextAuthProvider> | ||
</div> | ||
</ToggleProvider> | ||
</body> | ||
</html> | ||
</div> | ||
</Providers> | ||
</div> | ||
</Providers> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AuthLayout; | ||
export default RouteLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import "./globals.css"; | ||
import type { Metadata } from "next"; | ||
import { Inter } from "next/font/google"; | ||
import { ToggleProvider } from "@/contextProviders/ToggleProvider"; | ||
import Sidebar from "@/components/Sidebar"; | ||
import MainContent from "@/components/MainContent"; | ||
import NextAuthProvider from "@/contextProviders/sessionProvider"; | ||
import { Toaster } from "react-hot-toast"; | ||
import { Providers } from "@/store/provider"; | ||
import { Suspense } from "react"; | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export const metadata: Metadata = { | ||
title: "TPC Portal", | ||
description: "Generated by create next app", | ||
}; | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
auth: React.ReactNode; | ||
} | ||
|
||
const RouteLayout = async ({ children, auth }: Props) => { | ||
const className = inter.className; | ||
|
||
return ( | ||
<html lang="en"> | ||
<body className={className}> | ||
<ToggleProvider> | ||
<div className="flex flex-col h-screen"> | ||
{/* Page Content */} | ||
<Toaster /> | ||
|
||
<NextAuthProvider> | ||
{children} | ||
{auth} | ||
</NextAuthProvider> | ||
</div> | ||
</ToggleProvider> | ||
</body> | ||
</html> | ||
); | ||
}; | ||
|
||
export default RouteLayout; |