import "@mantine/core/styles.css"; import "./tailwind.css"; import "@fontsource/pixelify-sans"; import "@fontsource/nunito/800.css"; import { AppShell, Burger, Group, MantineProvider, Flex, Stack, Drawer } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import theme from "./theme"; import { usePageContext } from "vike-react/usePageContext"; import { IconBrandGithub, IconDownload, IconDeviceGamepad3, IconTrophy } from "@tabler/icons-react"; const links = [ { label: "Play", href: "/", icon: , }, { label: "Leaderboard", href: "/leaderboard", icon: , }, { label: "Download", href: "/download", icon: , }, { label: "GitHub", href: "https://github.com/Xevion/Pac-Man", icon: , }, ]; export function Link({ href, label }: { href: string; label: string }) { const pageContext = usePageContext(); const { urlPathname } = pageContext; const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href); return ( {label} ); } export default function LayoutDefault({ children }: { children: React.ReactNode }) { const [opened, { toggle, close }] = useDisclosure(); const mainLinks = links .filter((link) => link.href.startsWith("/")) .map((link) => ); const sourceLinks = links .filter((link) => !link.href.startsWith("/")) .map((link) => ( {link.icon} )); return (
{mainLinks} {sourceLinks} {children} {links.map((link) => ( ))}
); }