-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[MediaCard] Remove extraneous space when card has no actions #4538
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
[MediaCard] Remove extraneous space when card has no actions #4538
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. |
|
Is this project participating in hacktoberfest? |
Not that I know, but a huge thank you for this contribution! Could you also add a new example in https://github.com/emilycritter/polaris-react/blob/fix/media-card-extraneous-space/src/components/MediaCard/README.md to illustrate this use-case? |
| title="Getting Started" | ||
| description="Discover how Shopify can power up your entrepreneurial journey." |
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 content wouldn't be something we'd want without a call to action, but that's something that can be addressed separately.
|
Not sure adding a test is useful here, since visual regression tests would catch any issues with how layout is impacted by future changes. I'll let the maintainers decide! |
| </div> | ||
| ); | ||
| const actionMarkup = | ||
| primaryActionMarkup || secondaryActionMarkup ? ( |
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.
If we had codecov still active it would complain about not adding tests for this and we don't have visual regression testing at the moment so I think it worth adding a couple of tests here. I think we can just test to make sure button group doesn't render if primary or secondary actions are passed in
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.
Sounds good! I added a simple test in f729d60
|
Since some of the tests couldn't complete (probably due to the fact the PR comes from a fork), an admin will have to merge this PR. |
|
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
Fixes #4534
In vertical view (smaller viewports), MediaCard without primaryAction or secondaryAction has extra space at the bottom.
WHAT is this pull request doing?
This PR adds a conditional to check for actions thus removing an extra, empty div that was resulting in extraneous space at the bottom of the card.
Before:

After:
