if username and email are the same then display username only w/ burnettk

This commit is contained in:
jasquat 2023-05-18 10:11:24 -04:00
parent 7bfe43d617
commit c4e236e737
1 changed files with 6 additions and 5 deletions

View File

@ -97,6 +97,9 @@ export default function NavigationBar() {
aboutLinkElement = <a href="/about">About</a>; aboutLinkElement = <a href="/about">About</a>;
} }
const userEmail = UserService.getUserEmail();
const username = UserService.getPreferredUsername();
const profileToggletip = ( const profileToggletip = (
<div style={{ display: 'flex' }} id="user-profile-toggletip"> <div style={{ display: 'flex' }} id="user-profile-toggletip">
<Toggletip isTabTip align="bottom-right"> <Toggletip isTabTip align="bottom-right">
@ -105,15 +108,13 @@ export default function NavigationBar() {
className="user-profile-toggletip-button" className="user-profile-toggletip-button"
type="button" type="button"
> >
<div className="user-circle"> <div className="user-circle">{username[0].toUpperCase()}</div>
{UserService.getPreferredUsername()[0].toUpperCase()}
</div>
</ToggletipButton> </ToggletipButton>
<ToggletipContent className="user-profile-toggletip-content"> <ToggletipContent className="user-profile-toggletip-content">
<p> <p>
<strong>{UserService.getPreferredUsername()}</strong> <strong>{username}</strong>
</p> </p>
<p>{UserService.getUserEmail()}</p> {username !== userEmail && <p>{userEmail}</p>}
<hr /> <hr />
{aboutLinkElement} {aboutLinkElement}
<a target="_blank" href={documentationUrl} rel="noreferrer"> <a target="_blank" href={documentationUrl} rel="noreferrer">