Skip to content

Commit

Permalink
fix: conditional name in avatar and remove outline from navbar hambur…
Browse files Browse the repository at this point in the history
…ger button
  • Loading branch information
antoniomarcelob committed Apr 15, 2024
1 parent 3c98947 commit 1887516
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/HamburgerButton/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Hamburger = styled.button<{ isOpen: boolean }>`
border: none;
width: 30px;
height: 16px;
outline: none;
display: flex;
flex-direction: column;
justify-content: space-between;
Expand Down
6 changes: 3 additions & 3 deletions src/components/UserPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export const UserPopup = (props: UserPopupProps) => {
<ScopedCssBaseline>
<UserPopUp>
<UserPopUpContainer>
<StyledAvatar alt={user.name[0] ?? user.username?.charAt(0) ?? '-'}>
{(user.name[0] ?? user.username?.charAt(0)) ?? ''}
<StyledAvatar alt={user.name ?? user.name[0] ?? '' }>
{user.name ? user.name[0] : '-'}
</StyledAvatar>
<UserName>{user.name ?? user.username ?? 'User Display Name'}</UserName>
<UserName>{user.name ? user.name : '-'}</UserName>
<EmailContainer>
<IconGreen />
<p>{user.email}</p>
Expand Down
10 changes: 5 additions & 5 deletions src/lib-components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ export const Navbar = ({
onClick={handleUserMenu}
color='inherit'
>
<Avatar sx={{ bgcolor: '#db1e2f' }} alt={profile.name[0] ?? '-'}>
{profile.name[0]?.charAt(0) ?? profile.username?.charAt(0) ?? ''}
</Avatar>
<Avatar sx={{ bgcolor: '#db1e2f' }} alt={profile.name ? profile.name[0] : '-'}>
{profile.name ? profile.name?.charAt(0) : '-'}
</Avatar>
</IconButton>
</>
)}
Expand Down Expand Up @@ -307,8 +307,8 @@ export const Navbar = ({
onClick={handleUserMenu}
color='inherit'
>
<Avatar sx={{ bgcolor: '#db1e2f' }} alt={profile.name[0] ?? '-'}>
{profile.name[0].charAt(0)}
<Avatar sx={{ bgcolor: '#db1e2f' }} alt={profile.name ? profile.name[0] : '-'}>
{profile.name ? profile.name[0].charAt(0) : '-'}
</Avatar>
</IconButton>
)}
Expand Down

0 comments on commit 1887516

Please sign in to comment.