-
Notifications
You must be signed in to change notification settings - Fork 13
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
Ht3 #34
base: master
Are you sure you want to change the base?
Ht3 #34
Conversation
src/redux/reducers/order.js
Outdated
const { type, payload } = action; | ||
switch (type) { | ||
case INCREMENT: | ||
return { ...state, [payload.id]: (state[payload.id] || 0) + 1 }; | ||
case DECREMENT: | ||
return { ...state, [payload.id]: (state[payload.id] || 0) - 1 }; | ||
case CLEAR: |
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.
тут нужно было удалять только один конкретный продукт, а не все, что есть в корзине
src/components/basket/basket.js
Outdated
hideBasket, | ||
openBasket, | ||
}) => { | ||
const products = useMemo(() => { |
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.
👍
src/components/basket/basket.js
Outdated
decrement: (productId) => dispatch(decrement(productId)), | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(popup(Basket)); |
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.
тут лучше просто usePopup использовать в компоненте - намного очевиднее будет
src/components/basket/basket.js
Outdated
</button> | ||
{isOpenBasket && ( | ||
<div className={styles.products}> | ||
{products.map((product) => ( |
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.
на сколько я понимаю тут всегда показываются все продукты, даже те, которые мы не заказывали?
… HT3 # Conflicts: # src/components/app/app.js # src/components/basket/basket.js # src/components/basket/basket.module.css # src/redux/actions.js # src/redux/constants.js # src/redux/reducers/order.js
…into HT3 # Conflicts: # src/components/basket/basket.js # src/components/basket/basket.module.css
No description provided.