Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Ht3 #34

wants to merge 6 commits into from

Conversation

tatiyanakryzhnyaya
Copy link

No description provided.

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:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут нужно было удалять только один конкретный продукт, а не все, что есть в корзине

hideBasket,
openBasket,
}) => {
const products = useMemo(() => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

decrement: (productId) => dispatch(decrement(productId)),
});

export default connect(mapStateToProps, mapDispatchToProps)(popup(Basket));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут лучше просто usePopup использовать в компоненте - намного очевиднее будет

</button>
{isOpenBasket && (
<div className={styles.products}>
{products.map((product) => (
Copy link
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants