-
Notifications
You must be signed in to change notification settings - Fork 619
Prefill Promo code on coupon card from search param + scroll into view #4968
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
Prefill Promo code on coupon card from search param + scroll into view #4968
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @MananTank and the rest of your teammates on |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4968 +/- ##
=======================================
Coverage 47.66% 47.66%
=======================================
Files 1057 1057
Lines 57267 57267
Branches 3939 3939
=======================================
Hits 27299 27299
Misses 29277 29277
Partials 691 691
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
Merge activity
|
#4968) ## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces functionality for pre-filling a coupon code in the `ApplyCouponCard` component based on URL search parameters and enhances the user experience by scrolling into view when a coupon code is present. ### Detailed summary - Added `BadgeContainer` for pre-filled coupon code display in `ApplyCouponCard.stories.tsx`. - Utilized `useSearchParams` to retrieve the coupon code from the URL in `CouponCard.tsx`. - Enhanced `ApplyCouponCardUI` to accept `prefillPromoCode` and `scrollIntoView` props. - Implemented scrolling behavior to focus on the form when a coupon code is present. - Wrapped `ApplyCouponCard` in a `Suspense` component to manage loading states effectively. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
ff9ba30 to
9330401
Compare
151a38a to
9adf6e6
Compare

Problem solved
Short description of the bug fixed or feature added
PR-Codex overview
This PR enhances the
ApplyCouponCardcomponent by adding support for pre-filling a coupon code from URL search parameters and implementing a smooth scroll effect when the coupon is applied. It also introduces a loading state for the coupon section.Detailed summary
BadgeContainerwith a prefilled coupon code inApplyCouponCard.stories.tsx.useSearchParamsto retrieve the coupon code inCouponCard.tsx.ApplyCouponCardUI.ApplyCouponCardUIwhen a coupon code is present.LoadingCouponSectioncomponent for loading states in theCouponSection.