Skip to content

Commit

Permalink
Merge pull request #76 from Vidhanvyrs/DotLasher-Branch
Browse files Browse the repository at this point in the history
Done the asked changes
  • Loading branch information
dcruzb authored Aug 9, 2023
2 parents dff32c4 + 591609e commit b42005e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/components/UserPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export const UserPopup = (props: UserPopupProps) => {
return (
<ScopedCssBaseline>
<UserPopUp>
<UserPopUpContainer>
<StyledAvatar alt={user.name[0]}>
{user.name[0].charAt(0)}
</StyledAvatar>
<UserName>{user.name}</UserName>
<EmailContainer>
<IconGreen />
<p>{user.email}</p>
</EmailContainer>
<UserPopUpContainer>
<StyledAvatar alt={user.name[0] ?? user.username?.charAt(0)}>
{(user.name[0] ?? user.username?.charAt(0)) ?? ''}
</StyledAvatar>
<UserName>{user.name ?? user.username ?? 'User Display Name'}</UserName>
<EmailContainer>
<IconGreen />
<p>{user.email}</p>
</EmailContainer>
<ManageAccount href={`${accountManagementUrl}`}>
Gerenciar sua conta
</ManageAccount>
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Position {
export interface User {
name: string;
email: string;
username?: string;
profilePictureUrl?: string;
positions?: Position[];
}
Expand Down
7 changes: 4 additions & 3 deletions src/lib-components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const Navbar = ({
if (auth) {
setProfile({
name: auth.user?.profile?.given_name ?? '',
email: auth.user?.profile?.email ?? ''
email: auth.user?.profile?.email ?? '',
username: auth.user?.profile?.preferred_username ?? '',
});
}
}
Expand Down Expand Up @@ -190,8 +191,8 @@ export const Navbar = ({
color='inherit'
>
<Avatar sx={{ bgcolor: '#db1e2f' }} alt={profile.name[0]}>
{profile.name[0].charAt(0)}
</Avatar>
{profile.name[0]?.charAt(0) ?? profile.username?.charAt(0) ?? ''}
</Avatar>
</IconButton>
</>
)}
Expand Down

0 comments on commit b42005e

Please sign in to comment.