This commit is contained in:
Simon
2025-07-21 14:00:20 +02:00
committed by GitHub
parent 3a35adf545
commit 33aeb038bc
6 changed files with 84 additions and 28 deletions
@@ -1,4 +1,3 @@
import {useRouteMetadata} from 'Frontend/util/routing.js';
import {useEffect, useState} from 'react';
import ProfileMenu from "Frontend/components/ProfileMenu";
import {Button, Divider, Link, Navbar, NavbarBrand, NavbarContent, NavbarItem, Tooltip} from "@heroui/react";
@@ -21,18 +20,12 @@ export default function MainLayout() {
const location = useLocation();
const auth = useAuth();
const userPreferenceService = useUserPreferenceService();
const routeMetadata = useRouteMetadata();
const {setTheme} = useTheme();
const isSearchPage = location.pathname.startsWith("/search");
const isHomePage = location.pathname === "/";
const [isExploding, setIsExploding] = useState(false);
const games = useSnapshot(gameState).games;
useEffect(() => {
let newTitle = `Gameyfin - ${routeMetadata?.title}`;
window.addEventListener('popstate', () => document.title = newTitle);
}, []);
useEffect(() => {
userPreferenceService.sync()
.then(() => loadUserTheme().catch(console.error))