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

HT6 #51

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

HT6 #51

wants to merge 2 commits into from

Conversation

kustov-an
Copy link

No description provided.

@@ -21,13 +21,15 @@ function Basket({ title = 'Basket', total, orderProducts }) {
return (
<div className={styles.basket}>
<h4 className={styles.title}>{title}</h4>
{orderProducts.map(({ product, amount, subtotal }) => (
{orderProducts.map(({ product, amount, subtotal, restaurantId }) => (
<Link to={`/restaurants/${restaurantId}/menu`} >
Copy link
Owner

Choose a reason for hiding this comment

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

правильнее было бы завернуть именно имя продукта внутри компонента BasketItem, чтобы кнопки +/-/х остались без ссылок

@@ -44,6 +45,15 @@ export const orderProductsSelector = createSelector(
amount: order[product.id],
subtotal: order[product.id] * product.price,
}))
.map((orderProduct) => {
const restaurant = restaurants.find(restaurant =>
Copy link
Owner

Choose a reason for hiding this comment

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

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

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