From 802b9d3caf0187e0021d6143d4cb963dbf02074b Mon Sep 17 00:00:00 2001 From: madhuri-uppu Date: Mon, 9 Jun 2025 14:49:32 -0700 Subject: [PATCH 01/44] Trigger a modal if bonus products exist in AddToCart response --- .../app/components/_app/index.jsx | 51 +++--- .../app/components/product-view/index.jsx | 55 +++++-- .../app/hooks/use-bonus-product-modal.js | 139 +++++++++++++++++ .../app/hooks/use-bonus-product-modal.test.js | 145 ++++++++++++++++++ .../app/pages/checkout/index.jsx | 3 + .../app/pages/product-detail/index.jsx | 7 +- 6 files changed, 364 insertions(+), 36 deletions(-) create mode 100644 packages/template-retail-react-app/app/hooks/use-bonus-product-modal.js create mode 100644 packages/template-retail-react-app/app/hooks/use-bonus-product-modal.test.js diff --git a/packages/template-retail-react-app/app/components/_app/index.jsx b/packages/template-retail-react-app/app/components/_app/index.jsx index a841ef4930..957155e7b3 100644 --- a/packages/template-retail-react-app/app/components/_app/index.jsx +++ b/packages/template-retail-react-app/app/components/_app/index.jsx @@ -33,6 +33,7 @@ import {SkipNavLink, SkipNavContent} from '@chakra-ui/skip-nav' // Contexts import {CurrencyProvider} from '@salesforce/retail-react-app/app/contexts' +import {BonusProductModalProvider} from '@salesforce/retail-react-app/app/hooks/use-bonus-product-modal' // Local Project Components import Header from '@salesforce/retail-react-app/app/components/header' @@ -413,32 +414,32 @@ const App = (props) => { {!isOnline && } - - + - - {children} - - - - - {!isCheckout ?