-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
chore: new user avatar tooltip #9050
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
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.
Looks good to me 😄 Got a couple small questions and suggestions, but nothing major.
const StyledTooltipAvatar = styled(Avatar)(({ theme }) => ({ | ||
width: theme.spacing(5), | ||
height: theme.spacing(5), | ||
margin: 'auto', |
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.
out of curiosity: what's the margin auto doing here? Does ... does the avatar have some built-in margins?
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.
Not sure, was a copy paste from the existing styled avatar component.
backgroundColor: theme.palette.secondary.light, | ||
color: theme.palette.text.primary, | ||
fontSize: theme.fontSizes.smallerBody, | ||
fontWeight: theme.fontWeight.bold, |
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.
This, presumably, is to handle cases when we put letters instead of images?
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.
Which, ... I'm not sure we'll ever do? Because we only show this if we have src or imageurl?
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.
Yep, this made me rethink my approach. I'm now always showing an avatar in the tooltip with whatever content is in the original avatar, which is probably more reasonable and consistent:
</> | ||
<StyledTooltip> | ||
<ConditionallyRender | ||
condition={Boolean(src || user?.imageUrl)} |
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.
Isn't this condition redundant with the if check above?
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.
Also ... are we still using conditionally render? 🤔
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.
Isn't this condition redundant with the if check above?
Yep, it was. Good point.
Also ... are we still using conditionally render? 🤔
I don't know, are we? 🤷
I've dropped them in this file in the latest commit.
Co-authored-by: Thomas Heartman <[email protected]>
https://linear.app/unleash/issue/2-3109/improve-avatar-tooltip
I noticed our current user avatar tooltip is a bit poor.
This PR tries to improve it a bit using only the data we already have available, without any drastic changes.
Before
After
Other examples after the changes