-
Notifications
You must be signed in to change notification settings - Fork 196
@W-19168138 add a new modal to be used for bonus product selection modal #2988
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
@W-19168138 add a new modal to be used for bonus product selection modal #2988
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
…168138/add-new-modal/main change: new modal theme by Constantin
…168138/add-new-modal/main
For clarity can we rename the use-bonus-product-modal to use-bonus-product-selection-modal (also in other places where we use BonusProductModal=>BonusProductSelectionModal). |
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.
LSTM
</Button> | ||
{bonusDiscountLineItems && | ||
bonusDiscountLineItems.length > 0 && ( | ||
<> |
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.
Can we refactor this button into a new SelectBonusProductsButton component?
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 would be preferable
return null | ||
} | ||
|
||
// todo: this component will be replaced in the next work item. The component will display bonus products available for selection. |
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 still accurate correct?
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.
Yes, it's being removed in the next PR where I've added the products. It's in draft PR state and I shared it on Friday.
I think we should leave this comment here in this PR. And when the next one is merged it'll be removed with that.
|
||
const {pathname} = useLocation() | ||
useEffect(() => { | ||
if (state.isOpen) { |
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 modal state logic could probably be extracted into a reusable hook?
<Dialog.Backdrop /> | ||
<Dialog.Positioner> | ||
<Dialog.Content> | ||
<Dialog.Body bgColor="white" padding="8"> |
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.
prefer p={8} for consistency and token usage
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.
Did you mean padding={8}?
I see that in the code. But no p={8}
I'm curious did you encounter there any ux / accessibility issues with modal nested inside another modal? when you click the outside area, does both modal gets closed? This is an interesting UX pattern that we don't have a precedence. |
…168138/add-new-modal/main merge conflict in packages/template-chakra-storefront/src/hooks/index.js where the recently added line "export {useManualBonusProducts} from './use-manual-bonus-products'" was not being used as the file doesn't exist. I removed it
c5b280a
to
407faa9
Compare
…168138/add-new-modal/main
![]() These tests are failing from some changes already in the feature branch |
17a7bf6
into
feature/manual-bonus-products-v4
Description
Adding a foundation for bonus product selection functionality with proper modal management and integration with the existing add-to-cart flow.
Types of Changes
Changes
Screen.Recording.2025-08-04.at.9.19.18.AM.mov
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization