-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update Card.Section to accept ReactNode as title #781
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
👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. You can also join #polaris on the Shopify Partners Slack. |
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 is looking good. Can you please also add a test that asserts that a Subheading
is rendered when a string
is passed, as well as an entry in UNRELEASED.md
?
Sorry I haven't checked this! Updating with changes now |
8387566
to
383852f
Compare
All changes should be resolved now. |
383852f
to
73eee51
Compare
@tmlayton or @danrosenthal, have some time to take another look at this PR? |
Stale, feedback addressed
Looking at the Percy visual regression test failures, there are definitely some regressions caused by the removal of the |
c5f86d2
to
b161731
Compare
@danrosenthal Should have addressed the percy issues |
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.
A few changes still need to be made. I think this also warrants an additional example in the README
illustrating passing a React.ReactNode
as a title
. This serves the purpose of documenting it, as allowing us to check for visual regressions.
ab38213
to
87c7937
Compare
87c7937
to
bdd3578
Compare
1728b9b
to
34a9d7f
Compare
34a9d7f
to
8d05fbb
Compare
I'm not sure why Percy is showing a blank section for the addition I made in the |
Would anyone be able to verify the percy results for me? I am unable to approve them / I'm not sure I want to without a second pair of eyes. |
Updated |
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
According to the Polaris Design Doc it allows titles to be
React.ReactNode
. This is already implemented withinCard.Header
, however for sections this is not the case and currently enforces the title to be a string.WHAT is this pull request doing?
Updating the
Card.Section
to allow forReact.ReactNode
.Note This breaks breaks the design slightly for existing items that use a
React.ReactNode
in the title. Previously it would render within aSubheading
element, this change removes that.I am happy to provide a form of backwards compatibility and am open to suggestions.
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist