From feb44060c487e54494c39e5e692092b50cfe9397 Mon Sep 17 00:00:00 2001 From: Luke Betteridge Date: Wed, 15 Apr 2026 14:24:12 +0100 Subject: [PATCH] Users name now shows on navbar instead of email --- src/components/Navbar/Navbar.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx index a3664a4..1845033 100644 --- a/src/components/Navbar/Navbar.jsx +++ b/src/components/Navbar/Navbar.jsx @@ -5,6 +5,14 @@ import './Navbar.css' const MOBILE_NAV_BREAKPOINT = 760 +function formatUserDisplayName(user) { + const fullName = [user?.firstName, user?.lastName] + .filter(part => typeof part === 'string' && part.trim()) + .join(' ') + + return fullName || user?.email || 'Signed in' +} + function SunIcon() { return ( {isAuthenticated ? user?.email ?? 'Signed in' : 'Signed out'} + {isAuthenticated ? userDisplayName : 'Signed out'} {isAuthenticated && (