From 4fa08bda1c62fa1b578ad41a67db888e8b269537 Mon Sep 17 00:00:00 2001 From: Nitheesh T Ganesh Date: Tue, 6 Aug 2024 12:39:41 -0600 Subject: [PATCH] showing only the first name in the app bar instead of full name --- compliance-web/src/components/Shared/Header/EAOAppBar.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compliance-web/src/components/Shared/Header/EAOAppBar.tsx b/compliance-web/src/components/Shared/Header/EAOAppBar.tsx index 254c1b97..96ac469e 100644 --- a/compliance-web/src/components/Shared/Header/EAOAppBar.tsx +++ b/compliance-web/src/components/Shared/Header/EAOAppBar.tsx @@ -46,6 +46,8 @@ const EAOAppBar = forwardRef((_props, ref) => { setProfileMenuAnchorEl(null); }; + const userInitials = `${auth.user?.profile?.given_name?.charAt(0)}${auth.user?.profile?.family_name?.charAt(0)}`; + return ( <> @@ -81,7 +83,7 @@ const EAOAppBar = forwardRef((_props, ref) => { onMouseEnter={handleOpenProfileMenu} > - Hello, {auth.user?.profile.name} + Hello, {auth.user?.profile.given_name} ((_props, ref) => { variant="body1" fontWeight={700} color={theme.palette.primary.main} - >{`${auth.user?.profile?.given_name?.charAt(0)}${auth.user?.profile?.family_name?.charAt(0)}`} + >{userInitials} ) : (