-
Notifications
You must be signed in to change notification settings - Fork 1k
add imageProps
prop to Avatar
#7570
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
add imageProps
prop to Avatar
#7570
Conversation
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 seems like a reasonable enhancement, thank you!
@jcfilben Are you comfortable with this API? Would there be any reason instead to structure as imageProps
similar to dropProps
on other components?
So instead of
<Avatar fallback="" />
it would be
<Avatar imageProps={{ fallback: '' }} />
Not sure if any of the other image props would ever be relevant in Avatar scenario.
I like the idea of |
7749786
to
15241ad
Compare
fallback
prop to AvatarimageProps
prop to Avatar
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! Thanks @max-capozzi-hpe
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, thanks for the contribution @max-capozzi-hpe!
Waiting to merge until after we release v2.46.1 |
Signed-off-by: Max Capozzi <max.capozzi@hpe.com>
15241ad
to
0fa2187
Compare
What does this PR do?
adds the
imageProps
prop toAvatar
to add missing props for theImage
used internally byAvatar
Where should the reviewer start?
Avatar.js
What testing has been done on this PR?
manually tested with Storybook
How should this be manually tested?
Storybook
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
What are the relevant issues?
#6530
Screenshots (if appropriate)
Do the grommet docs need to be updated?
Yes
Should this PR be mentioned in the release notes?
Yes
Is this change backwards compatible or is it a breaking change?
Backwards compatible