Skip to content
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

Applies to section #159

Merged
merged 8 commits into from
Sep 27, 2023
Merged

Applies to section #159

merged 8 commits into from
Sep 27, 2023

Conversation

devisscher
Copy link
Contributor

@devisscher devisscher commented Sep 20, 2023

What problem is this PR solving?

Resolves: #137

  • Add the AppliesTo section
  • Add the AppliesTo section in the value card
  • Add readmes for applies to section and value card

image
image
image
image

Reviewers’ hat-rack 🎩

  1. Run storybook yarn storybook
  2. Look at the ValueCard and make sure the AppliesTo section works as expected.

Before you deploy

Warning
With every PR, you MUST think through each of the items in the following checklist and check the appropriate ones. This step cannot be overlooked by the PR author or its reviewers. Please remove this warning when you're done.

  • This PR is safe to rollback.
  • I tophatted this change on Storybook.

@github-actions
Copy link
Contributor

Hello and thank you for your contribution! Before we can merge your pull request, we ask that you create a changeset to describe your changes. This will help us manage versions and release notes. You can create a changeset by running yarn changeset in your terminal. You can find more information about our contribution guidelines here. Thank you again!


return (
<Page>
<AppliesTo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could wrap this in a Card so that it stands out a bit more in the stories :)

Copy link
Contributor

@mathiusj mathiusj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nit for the story to be wrapped in a card, but LGTM otherwise! 🙏

Copy link
Contributor

@aeperea aeperea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit comments
lgtm!

}, [productSelector, collectionSelector, eligibility]);
return (
<>
{productSelector || collectionSelector ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rendering condition is duplicated in the ValueCard component. Probably better if the parent component takes care of the rendering responsibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reluctant to remove this because the component could be rendered on its own, without the value card. So I wonder if it's better to leave that logic in both places?

@@ -225,6 +239,16 @@ export function ValueCard({
}
/>
)}
{eligibility &&
selectedItems &&
(productSelector || collectionSelector) ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in the AppliesTo component.
nit: extract it into a variable for readability

@devisscher
Copy link
Contributor Author

Just a small nit for the story to be wrapped in a card, but LGTM otherwise! 🙏

It looks like CurrencyField or Date selectors aren't wrapped in cards, for consistency would it be ok if we left the AppliesTo section outside of a card? (Since it would be meant to be used inside another card, in most cases inside the ValueCard?)

@mathiusj
Copy link
Contributor

Just a small nit for the story to be wrapped in a card, but LGTM otherwise! 🙏

It looks like CurrencyField or Date selectors aren't wrapped in cards, for consistency would it be ok if we left the AppliesTo section outside of a card? (Since it would be meant to be used inside another card, in most cases inside the ValueCard?)

if that's the pattern we are maintaining currently, sure!

@devisscher devisscher merged commit f6a397a into main Sep 27, 2023
5 checks passed
@devisscher devisscher deleted the applies-to-section branch September 27, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Applies to section
3 participants