-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved Issue [#1742] Implemented MUI Tooltip for the UserAvatar com… #1743
base: main
Are you sure you want to change the base?
Conversation
…Avatar component, displays the user's name on hover.
@nitverse thank you for you contribution, can you fix the eslint error in the ci: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most pressing concern is fixing the tooltip to appear above the header.
|
||
function UserAvatar({ auth }) { | ||
if (!auth?.isAuthenticated) { | ||
return null; | ||
} | ||
|
||
const userName = auth?.user?.profile.preferred_username[0] || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think userName should be set to auth?.user?.profile.preferred_username || null.
That way, when you highlight the tooltip--which is currently just the first letter of their username--it will give new information, instead of repeating information the user already has.
}} | ||
> | ||
<Avatar | ||
<Tooltip title={userName} arrow> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the arrow tooltip will show up behind the header/banner of the website. This is likely due to the header having a z-index of '9999'.
I am hesitant to suggest changing the header zindex to anything lower in the event it ruins the format in some place I'm unaware of. I am open to suggestions or ideas. @dadiorchen ?
color: ({ palette }) => palette.text.contrast, | ||
}} | ||
> | ||
{userName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change this to {userName ? userName[0] : null} to conform with the idea on line 8.
Description
Implemented MUI Tooltip in the
UserAvatar
component, enhancing the user experience by displaying the user's name on hover.Type of change
How Has This Been Tested?
Checklist: