From c642b4deb54a03f85f241280a6a6d5e74eeb5b72 Mon Sep 17 00:00:00 2001 From: Ryan Salazar Date: Fri, 8 May 2026 21:05:32 +0000 Subject: [PATCH] Header: split Sign In / My Account by auth state, route Sign In to /client-login Desktop nav (and mobile drawer) now show different account-related links depending on auth state: - Anonymous: Sign In (-> /client-login) + Register - Authenticated: My Account + My Profile - Admin-tier (administrator/admin/super_admin/editor/support): plus the full admin block (already gated by isAdmin from earlier commit) Previously a single 'Sign In / My Account' link pointed at /account regardless of auth state, which forced anonymous users through a server-side bounce to the login page. Now Sign In links straight to the canonical /client-login. --- src/components/Header.tsx | 69 ++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 59f4440..75118b9 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -240,18 +240,25 @@ export default function Header() { {/* Language Switcher — Section 18B */}
- - {currentUserId ? "My Account" : "Sign In"} - {!currentUserId && ( - - Register - + <> + + Sign In + + + Register + + )} {currentUserId && ( - - My Profile - + <> + + My Account + + + My Profile + + )} {isAdmin && ( <> @@ -457,16 +464,40 @@ export default function Header() { Reading List - {/* Account mobile link */} - setMobileOpen(false)}> - - Account - + {/* Account / Sign In / Register — anonymous vs authenticated */} + {!currentUserId && ( + <> + setMobileOpen(false)}> + + Sign In + + setMobileOpen(false)}> + + Register + + + )} + {currentUserId && ( + setMobileOpen(false)}> + + My Account + + )} {/* WP Import mobile link */} {isAdmin && (