-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[Avatar] Add avatar component #1210
Conversation
Netlify deploy preview |
Hey @acomanescu thanks for the contribution. We will be working soon on the roadmap for Base UI, where we will share the next components we have in the pipeline. As of now, the Avatar component is not planned, but please keep an eye on the GH Roadmap/issues if you want to contribute with something else. If you are interested in Base UI introducing an Avatar component, please create an issue for it. Thank you! |
Hi @mnajdova, thank you for your response. I am closing this PR. |
I've created an issue for Avatar and added it to the current cycle. I'll reopen this PR and take a look soon. Thanks @acomanescu! |
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 great, I left some initial feedback. I will let Colm review the docs demo
docs/src/app/(public)/(content)/react/components/avatar/demos/hero/css-modules/index.tsx
Outdated
Show resolved
Hide resolved
@acomanescu Good work 🙏
|
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@mnajdova Hi! It's great that the roadmap will be shared! Is there any ETA for this? Or at least what format it will be published in? Looking forward to it. |
It will likely be shared here on GitHub as a project, but we can share more info on Discord when it'll be ready. |
|
||
export function useImageLoadingStatus( | ||
src?: string, | ||
referrerPolicy?: React.HTMLAttributeReferrerPolicy, |
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.
referrerPolicy
seems unused anywhere
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.
Fixed in cc939fc
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 could use a test that verifies if the fallback is displayed when the image fails to load and a one testing the delay prop.
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.
Added in 98457eb
const { | ||
className, | ||
render, | ||
onLoadingStatusChange: onLoadingStatusChangeProp, |
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.
onLoadingStatusChange
wasn't reflected in the API docs before, fixed in df65f19
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.
@colmtuite @michaldudak @mnajdova This PR should be ready to review again, I've gone through the existing comments fixed them all, also made some extra fixes.
In particular: I've removed useAvatarRoot
and moved everything to the AvatarRoot
component, the prop getter seems unnecessary and without that there's only a simple useState remaining 8c0e720
f129e6f
to
83870fe
Compare
Perhaps add |
Added 👍 |
@dartess we updated the project with the near future plans/initiatives, you can check it here: https://github.com/orgs/mui/projects/1/views/13. We will keep updating it for each iteration. |
Preview: https://deploy-preview-1210--base-ui.netlify.app/react/components/avatar
This PR adds the Avatar component. I wasn't able to run the tests due to some Mocha run errors that happen even when I run the tests on a fresh clone.
Closes #1347