54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
"use client";
|
|
import "./style.css";
|
|
import { useState } from "react";
|
|
import { AuthProvider } from "react-oidc-context";
|
|
import { oidcConfig, userManager } from "muzak/config/auth";
|
|
import { Source_Sans_3, Nunito } from "next/font/google";
|
|
import AuthStatus from "muzak/components/AuthStatus";
|
|
import NavigationBar from "muzak/components/NavigationBar";
|
|
import Quota from "muzak/components/Quota";
|
|
import { AnimationContext } from "muzak/contexts/AnimationContext";
|
|
import { QuotaContext } from "muzak/contexts/QuotaContext";
|
|
|
|
const nunito = Nunito({
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
function LayoutContent({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<>
|
|
<AuthStatus />
|
|
{children}
|
|
{/* <NavigationBar /> */}
|
|
<Quota />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const [isAnimate, setIsAnimate] = useState(false);
|
|
const [quota, setQuota] = useState<number | null>(null);
|
|
|
|
const toggleAnimation = () => {
|
|
setIsAnimate(!isAnimate);
|
|
};
|
|
|
|
return (
|
|
<html lang="en" className={nunito.className}>
|
|
<body className={`bg-game-show ${isAnimate ? "animate" : ""} h-screen`}>
|
|
<AuthProvider {...oidcConfig}>
|
|
<AnimationContext.Provider value={{ isAnimate, setIsAnimate }}>
|
|
<QuotaContext.Provider value={{ quota, setQuota }}>
|
|
<LayoutContent children={children} />
|
|
</QuotaContext.Provider>
|
|
</AnimationContext.Provider>
|
|
</AuthProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|