1. refactor navigation + add additional nav items

2. authentication changes
This commit is contained in:
2026-02-07 21:17:41 -05:00
parent 8abb12d369
commit af73e162c5
6 changed files with 369 additions and 55 deletions

View File

@@ -22,9 +22,19 @@ const navItems = [
{ label: "Memes", href: "/memes" },
{ label: "TRip", href: "/TRip", auth: true, icon: "pirate" },
{ label: "Discord Logs", href: "/discord-logs", auth: true },
{ label: "Lighting", href: "/lighting", auth: true },
{ label: "Status", href: "https://status.boatson.boats", icon: "external" },
{ label: "Lighting", href: "/lighting", auth: true, adminOnly: true },
{ label: "Git", href: "https://kode.boatson.boats", icon: "external" },
{ label: "Glances", href: "https://_gl.codey.lol", auth: true, icon: "external",
adminOnly: true },
{ label: "PSQL", href: "https://_pg.codey.lol", auth: true, icon: "external",
adminOnly: true },
{ label: "qBitTorrent", href: "https://_qb.codey.lol", auth: true, icon: "external",
adminOnly: true },
{ label: "RQ", href: "https://_rq.codey.lol", auth: true, icon: "external",
adminOnly: true },
{ label: "RI", href: "https://_r0.codey.lol", auth: true, icon: "external",
adminOnly: true },
// { label: "Status", href: "https://status.boatson.boats", icon: "external" },
{ label: "Login", href: "/login", guestOnly: true },
...(isLoggedIn ? [{ label: "Logout", href: "#logout", onclick: "handleLogout()" }] : []),
];
@@ -34,6 +44,10 @@ const visibleNavItems = navItems.filter((item) => {
return false;
}
if (item.adminOnly && !isAdmin) {
return false;
}
if (item.guestOnly && isLoggedIn) {
return false;
}
@@ -155,7 +169,7 @@ const currentPath = Astro.url.pathname;
<!-- Mobile Navigation Menu -->
<div
id="mobile-menu"
class="mobile-menu-dropdown md:hidden"
class="mobile-menu-dropdown xl:hidden"
>
{isLoggedIn && userDisplayName && (
<div class:list={['nav-user-inline', 'nav-user-inline--mobile', isAdmin && 'nav-user-inline--admin']} title={`Logged in as ${userDisplayName}`}>