From 791a4fcb702a4d29a06d212af063b380bcc734b6 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 4 Jun 2026 16:00:19 -0700 Subject: [PATCH] Fix relay link, add admin navigation item on mobile --- frontend/src/components/AppShell.tsx | 61 +++++++++++++++++++ .../src/components/relay/RelayCardHeader.tsx | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/AppShell.tsx b/frontend/src/components/AppShell.tsx index 2d060e6..29f0cea 100644 --- a/frontend/src/components/AppShell.tsx +++ b/frontend/src/components/AppShell.tsx @@ -26,6 +26,14 @@ function RelayIcon() { return } +function AdminIcon() { + return ( + + ) +} + export default function AppShell(props: { children?: any }) { const location = useLocation() const picture = useProfilePicture(() => account()?.pubkey) @@ -33,6 +41,7 @@ export default function AppShell(props: { children?: any }) { const [tenantRelays] = useTenantRelays() const [searchOpen, setSearchOpen] = createSignal(false) const [searchQuery, setSearchQuery] = createSignal("") + const [adminOpen, setAdminOpen] = createSignal(false) const username = createMemo(() => metadata()?.name || metadata()?.display_name || shortenPubkey(account()?.pubkey)) const nip05 = createMemo(() => metadata()?.nip05) @@ -57,11 +66,20 @@ export default function AppShell(props: { children?: any }) { : "block rounded-lg px-3 py-2 text-sm text-white/80 hover:bg-white/10 hover:text-white" } + const mobileNavItemClass = (href: string) => { + const active = location.pathname === href || location.pathname.startsWith(`${href}/`) + return active + ? "block rounded-lg bg-gray-100 px-3 py-3 text-sm font-medium text-gray-900" + : "block rounded-lg px-3 py-3 text-sm text-gray-700 hover:bg-gray-100" + } + const openSearchModal = () => setSearchOpen(true) const closeSearchModal = () => { setSearchOpen(false) setSearchQuery("") } + const openAdminModal = () => setAdminOpen(true) + const closeAdminModal = () => setAdminOpen(false) return (
@@ -115,6 +133,7 @@ export default function AppShell(props: { children?: any }) { class="fixed inset-x-0 bottom-0 z-20 border-t border-gray-200 bg-white md:hidden" onClick={() => { if (searchOpen()) closeSearchModal() + if (adminOpen()) closeAdminModal() }} >
@@ -133,6 +152,19 @@ export default function AppShell(props: { children?: any }) { + + +
+ + +
+

Administration

+ +
+
+ ) } diff --git a/frontend/src/components/relay/RelayCardHeader.tsx b/frontend/src/components/relay/RelayCardHeader.tsx index 7b33f1d..7e0ef08 100644 --- a/frontend/src/components/relay/RelayCardHeader.tsx +++ b/frontend/src/components/relay/RelayCardHeader.tsx @@ -84,7 +84,7 @@ export default function RelayCardHeader(props: RelayCardHeaderProps) { wss://{r().subdomain}.{RELAY_DOMAIN}