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

Do not render Text component if discountMethodHidden #135

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

bkspace
Copy link
Contributor

@bkspace bkspace commented Sep 13, 2023

What problem is this PR solving?

In edit mode, the MethodCard has incorrect spacing between the discount title and the title label/input. This is because the Text component still consumes space with an empty child. This PR, instead wraps the Text component in the relevant if check.

Before:
CleanShot 2023-09-13 at 08 32 25@2x

After:
CleanShot 2023-09-13 at 08 33 41@2x

Reviewers’ hat-rack 🎩

In src/stories/patterns/MethodCardPattern/MethodCardPattern.tsx add the following prop, and check storybook:

discountMethodHidden={true}

Before you deploy

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

Copy link
Contributor

@devisscher devisscher left a comment

Choose a reason for hiding this comment

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

Thanks again @bkspace! 🔥

@devisscher devisscher force-pushed the fix-method-card-spacing-edit branch 2 times, most recently from 96579d3 to 0612d0b Compare September 13, 2023 12:48
@devisscher devisscher force-pushed the fix-method-card-spacing-edit branch from 0612d0b to 7c07412 Compare September 13, 2023 13:00
@devisscher devisscher merged commit 627ef9f into Shopify:main Sep 13, 2023
3 checks passed
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.

2 participants