nu met de juiste files toegevoegd
This commit is contained in:
@@ -6,6 +6,7 @@ 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";
|
||||
|
||||
const sourceSans = Source_Sans_3({
|
||||
weight: ["400"],
|
||||
@@ -16,12 +17,21 @@ const nunito = Nunito({
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
function LayoutContent({ children }: { children: React.ReactNode }) {
|
||||
function LayoutContent({
|
||||
children,
|
||||
quota,
|
||||
setQuota,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
quota: number | null;
|
||||
setQuota: React.Dispatch<React.SetStateAction<number | null>>;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AuthStatus />
|
||||
{children}
|
||||
<NavigationBar />
|
||||
<Quota quota={quota} setQuota={setQuota} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -32,6 +42,7 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [isAnimate, setIsAnimate] = useState(false);
|
||||
const [quota, setQuota] = useState<number | null>(null);
|
||||
|
||||
const toggleAnimation = () => {
|
||||
setIsAnimate(!isAnimate);
|
||||
@@ -41,7 +52,11 @@ export default function RootLayout({
|
||||
<html lang="en" className={nunito.className}>
|
||||
<body className={`bg-game-show ${isAnimate ? "animate" : ""} h-screen`}>
|
||||
<AuthProvider {...oidcConfig}>
|
||||
<LayoutContent>{children}</LayoutContent>
|
||||
<LayoutContent
|
||||
children={children}
|
||||
quota={quota}
|
||||
setQuota={setQuota}
|
||||
/>
|
||||
</AuthProvider>
|
||||
<button
|
||||
className={`absolute top-1 left-1 ${isAnimate ? "pause" : "play"}`}
|
||||
|
||||
@@ -64,21 +64,12 @@ export const api = {
|
||||
votes: {
|
||||
list: fetcher.path("/api/vote/").method("get").create(),
|
||||
detail: fetcher.path("/api/vote/{id}").method("get").create(),
|
||||
userVotes: fetcher.path("/api/user/{user_id}/votes").method("get").create(),
|
||||
},
|
||||
users: {
|
||||
list: fetcher.path("/api/user/").method("get").create(),
|
||||
detail: fetcher.path("/api/user/{id}").method("get").create(),
|
||||
},
|
||||
profiles: {
|
||||
detail: fetcher.path("/api/profile/{id}").method("get").create(),
|
||||
backgrounds: {
|
||||
list: fetcher.path("/api/profile/background").method("get").create(),
|
||||
detail: fetcher
|
||||
.path("/api/profile/background/{id}")
|
||||
.method("get")
|
||||
.create(),
|
||||
},
|
||||
me: fetcher.path("/api/profile/me").method("get").create(),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -86,5 +77,6 @@ export type User = components["schemas"]["User"];
|
||||
export type Track = components["schemas"]["Track"];
|
||||
export type Album = components["schemas"]["Album"];
|
||||
export type Vote = components["schemas"]["Vote"];
|
||||
export type Profile = components["schemas"]["Profile"];
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user