2025-02-15 17:18:58 -06:00
|
|
|
"use client";
|
2025-02-15 22:56:37 -06:00
|
|
|
import { BrandingGenericIcon } from "@/components/feat/icons/branding-icons";
|
2025-02-16 21:40:17 -06:00
|
|
|
import { Button } from "@/components/ui/button";
|
2025-02-16 13:37:40 -06:00
|
|
|
import {
|
|
|
|
|
ContextMenu,
|
|
|
|
|
ContextMenuContent,
|
|
|
|
|
ContextMenuItem,
|
|
|
|
|
ContextMenuSeparator,
|
|
|
|
|
ContextMenuTrigger,
|
|
|
|
|
} from "@/components/ui/context-menu";
|
2025-02-16 21:40:17 -06:00
|
|
|
import {
|
|
|
|
|
DropdownMenu,
|
|
|
|
|
DropdownMenuContent,
|
|
|
|
|
DropdownMenuTrigger,
|
|
|
|
|
} from "@/components/ui/dropdown-menu";
|
2025-02-16 13:37:40 -06:00
|
|
|
import Github from "@/components/ui/github";
|
|
|
|
|
import { ALegacy } from "@/components/util/link";
|
2025-02-15 17:18:58 -06:00
|
|
|
import { version } from "@/config/version";
|
2025-02-15 20:06:35 -06:00
|
|
|
import { useScroll } from "@/lib/hooks/use-scroll";
|
2025-02-15 17:18:58 -06:00
|
|
|
import { cn } from "@/lib/utils";
|
2025-02-16 21:40:17 -06:00
|
|
|
import { Menu, ServerCrash } from "lucide-react";
|
2025-02-15 20:06:35 -06:00
|
|
|
import Link from "next/link";
|
2025-02-16 21:40:17 -06:00
|
|
|
import { MenuDropdown } from "./menu-dropdown";
|
2025-02-15 17:18:58 -06:00
|
|
|
|
|
|
|
|
export function NavBar() {
|
2025-02-15 20:06:35 -06:00
|
|
|
const showBorder = useScroll(40);
|
|
|
|
|
|
2025-02-15 17:18:58 -06:00
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
2025-02-15 20:06:35 -06:00
|
|
|
"w-screen h-[3rem] grid-cols-3 fixed backdrop-blur-xl z-10 flex",
|
2025-02-16 13:37:40 -06:00
|
|
|
"items-center justify-self-start me-auto pl-4 flex-1 transition-all justify-between",
|
2025-02-15 20:06:35 -06:00
|
|
|
showBorder ? "border-b" : ""
|
2025-02-15 17:18:58 -06:00
|
|
|
)}
|
|
|
|
|
>
|
2025-02-16 13:37:40 -06:00
|
|
|
<span>
|
|
|
|
|
<ContextMenu>
|
|
|
|
|
<ContextMenuTrigger>
|
|
|
|
|
<Link className="gap-5 flex items-center " href="/">
|
|
|
|
|
<BrandingGenericIcon className="max-w-[32px] max-h-[32px] mt-0.5" />
|
|
|
|
|
<span className="gap-2 flex group hover:text-blue-500 hover:underline transition-all">
|
|
|
|
|
<strong className="">MHSF</strong>
|
|
|
|
|
<span className="text-muted-foreground group-hover:text-blue-500 transition-all">
|
|
|
|
|
v{version}
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</Link>
|
|
|
|
|
</ContextMenuTrigger>
|
|
|
|
|
<ContextMenuContent className="overflow-hidden min-w-[300px]">
|
|
|
|
|
<ALegacy href="Special:Root">
|
|
|
|
|
<ContextMenuItem>
|
|
|
|
|
<span className="pl-2 flex gap-2 items-center">
|
|
|
|
|
<ServerCrash size={16} /> Go home
|
|
|
|
|
</span>
|
|
|
|
|
</ContextMenuItem>
|
|
|
|
|
</ALegacy>
|
|
|
|
|
<ContextMenuSeparator />
|
|
|
|
|
<ALegacy href="Special:GitHub">
|
|
|
|
|
<ContextMenuItem>
|
|
|
|
|
<span className="pl-2 flex gap-2 items-center">
|
|
|
|
|
<Github /> Open GitHub
|
|
|
|
|
</span>
|
|
|
|
|
</ContextMenuItem>
|
|
|
|
|
</ALegacy>
|
2025-02-16 21:40:17 -06:00
|
|
|
<ALegacy href="Special:GitHub/releases">
|
|
|
|
|
<ContextMenuItem>
|
|
|
|
|
<span className="pl-2 flex gap-2 items-center">
|
|
|
|
|
<Github /> Open GitHub Releases
|
|
|
|
|
</span>
|
|
|
|
|
</ContextMenuItem>
|
|
|
|
|
</ALegacy>
|
2025-02-16 13:37:40 -06:00
|
|
|
</ContextMenuContent>
|
|
|
|
|
</ContextMenu>
|
|
|
|
|
</span>
|
2025-02-16 21:40:17 -06:00
|
|
|
<span className="mr-3 flex items-center">
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger>
|
|
|
|
|
<Button
|
|
|
|
|
className="rounded-full flex items-center"
|
|
|
|
|
size="square-lg"
|
|
|
|
|
variant="secondary"
|
|
|
|
|
>
|
|
|
|
|
<Menu size={16} />
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
|
|
|
|
<DropdownMenuContent className="max-w-[280px] w-[280px] mt-2 mr-2">
|
|
|
|
|
<MenuDropdown />
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
2025-02-16 13:37:40 -06:00
|
|
|
</span>
|
2025-02-15 17:18:58 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|