Skip to content

Commit 6d9ca82

Browse files
authored
Recommended Products: fix toggling of the favorite icon (@W-16093853@) (#1861)
* Recommended Products: fix toggling of the favorite icon * Update CHANGELOG.md
1 parent 2948615 commit 6d9ca82

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
- Fix seo component not settings keywords meta tag [#1762](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1762)
2626
- [a11y] Replace p tag with heading tags in cart page [#1818](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1818)
27+
- Fix RecommendedProducts' toggling of the favourite icon [#1861](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1861)
2728

2829

2930
## v2.4.1 (Apr 17, 2024)

packages/template-retail-react-app/app/components/recommended-products/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ const RecommendedProducts = ({zone, recommender, products, title, shouldFetch, .
197197
isFavourite: wishlist?.customerProductListItems?.some(
198198
(item) => item.productId === product?.productId
199199
),
200-
onFavouriteToggle: (isFavourite) => {
201-
const action = isFavourite ? removeItemFromWishlist : addItemToWishlist
200+
onFavouriteToggle: (toBeFavourite) => {
201+
const action = toBeFavourite ? addItemToWishlist : removeItemFromWishlist
202202
return action(product)
203203
}
204204
})}

packages/template-retail-react-app/app/pages/product-list/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,8 @@ const ProductList = (props) => {
582582
)
583583
}
584584
}}
585-
onFavouriteToggle={(isFavourite) => {
586-
const action = isFavourite
585+
onFavouriteToggle={(toBeFavourite) => {
586+
const action = toBeFavourite
587587
? addItemToWishlist
588588
: removeItemFromWishlist
589589
return action(productSearchItem)

0 commit comments

Comments
 (0)