-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[MediaCard] Update to accept ReactNode as title and optional primaryAction #3552
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
Conversation
@alex-page Could someone please review this pull request? |
Love this @devchris 👏. Just for shared context are there any examples of reasons you needed this flexibility? I see you added the |
Co-authored-by: Alex Page <alex@alexpage.com.au>
I was using it with a For the optional |
Co-authored-by: Alex Page <alex@alexpage.com.au>
Co-authored-by: Ben Scott <227292+BPScott@users.noreply.github.com>
@alex-page can this be merged please? 😊 |
🎉 Thanks for your contribution to Polaris React! |
…ction (#3552) Co-authored-by: Alex Page <alex@alexpage.com.au> Co-authored-by: Ben Scott <227292+BPScott@users.noreply.github.com>
WHY are these changes introduced?
To keep add more functionality to the MediaCard similar to what regular Cards are already doing. So far, MediaCards do not accept ReactNodes as a title. If you do, the console log throws a bunch of warnings that you shouldn't nest stuff in paragraphs.
Also, when using a MediaCard, you are forced to set a primaryAction. This is not always wanted behavior. Maybe you just want to display something.
WHAT is this pull request doing?
It allows the MediaCard title to accept a ReactNode. In addition, it makes the primaryAction optional.
🎩 checklist
README.md
with documentation changes