Added ProfileMenu

Bit of refactoring
This commit is contained in:
grimsi
2024-05-19 11:48:00 +02:00
parent a61c8eead0
commit 3b72c843db
11 changed files with 206 additions and 108 deletions
+25 -17
View File
@@ -1,20 +1,22 @@
import {useRouteMetadata} from 'Frontend/util/routing.js';
import {useEffect} from 'react';
import ProfileMenu from "Frontend/components/ProfileMenu";
import {Outlet} from "react-router-dom";
import {Navbar, NavbarBrand, NavbarContent, NavbarItem} from "@nextui-org/react";
import {Divider, Link, Navbar, NavbarBrand, NavbarContent, NavbarItem} from "@nextui-org/react";
import GameyfinLogo from "Frontend/components/theming/GameyfinLogo";
import * as PackageJson from "../../package.json";
import {Outlet, useNavigate} from "react-router-dom";
export default function MainLayout() {
const currentTitle = `Gameyfin - ${useRouteMetadata()?.title}` ?? 'Gameyfin';
useEffect(() => {
document.title = currentTitle;
}, [currentTitle]);
const navigate = useNavigate();
return (
<>
<div className="flex flex-col min-h-svh">
<Navbar maxWidth="2xl" className="shadow">
<NavbarBrand>
<NavbarBrand as="button" onClick={() => navigate('/')}>
<GameyfinLogo className="h-10 fill-foreground"/>
</NavbarBrand>
<NavbarContent justify="end">
@@ -24,19 +26,25 @@ export default function MainLayout() {
</NavbarContent>
</Navbar>
<Outlet/>
</>
<div className="flex-1">
<div className="flex-row relative m-auto max-w-[1536px] align-self-center px-2 pt-4">
<Outlet/>
</div>
</div>
<Divider/>
<footer className="flex flex-row items-center justify-between py-4 px-12">
<p>Gameyfin {PackageJson.version}</p>
<p>
&copy; {(new Date()).getFullYear()}&ensp;
<Link href="https://github.com/gameyfin/gameyfin/graphs/contributors" target="_blank">
Gameyfin contributors
</Link>
</p>
</footer>
</div>
);
}
/*<footer
className="flex flex-row w-full items-center justify-between px-10 py-4">
<Typography color="blue-gray">
Gameyfin v{packageJson.version}
</Typography>
<Typography color="blue-gray">
&copy; {(new Date()).getFullYear()} <a
href="https://github.com/gameyfin/gameyfin/graphs/contributors" target="_blank">Gameyfin
contributors</a>
</Typography>
</footer>*/
/**/