-
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
HT6 #51
base: master
Are you sure you want to change the base?
HT6 #51
Conversation
@@ -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`} > |
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.
правильнее было бы завернуть именно имя продукта внутри компонента 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 => |
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.
вот это вычисление лучше вынести в отдельный селектор, чтобы не вычислять это при любом изменении заказа
No description provided.