From f93b0535696445609dc220548c5d148b0e3fefca Mon Sep 17 00:00:00 2001 From: DeathKaioken Date: Thu, 16 Oct 2025 08:07:31 +0200 Subject: [PATCH] feat: admin navigation in header --- src/app/components/nav/Header.tsx | 55 ++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/app/components/nav/Header.tsx b/src/app/components/nav/Header.tsx index 10af093..6279fe5 100644 --- a/src/app/components/nav/Header.tsx +++ b/src/app/components/nav/Header.tsx @@ -187,15 +187,22 @@ export default function Header() { const isLoggedIn = !!user const userPresent = mounted && isLoggedIn + // NEW: detect admin role across common shapes + const isAdmin = + !!user && + ( + (user as any)?.role === 'admin' || + (user as any)?.userType === 'admin' || + (user as any)?.isAdmin === true || + ((user as any)?.roles?.includes?.('admin')) + ) + return (
- {/* REMOVE sub header bar */} - {/* ...existing code... */} - {/* Deleted previous Sub header nav for Referral Management */} - {/* ...existing code... */} + {/* Admin subheader (gold) - centered */} + {userPresent && isAdmin && ( +
+
+
+ + Admin Navigation + + + + +
+
+
+ )} + {/* Mobile dialog and rest of header */}