-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/ht6 #81
base: master
Are you sure you want to change the base?
Feature/ht6 #81
Conversation
@@ -36,10 +36,22 @@ function Restaurants({ restaurants, loading, loaded, loadRestaurants }) { | |||
))} | |||
</div> | |||
<Switch> | |||
<Route path="/restaurants/:restId/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.
этот роутинг проще описать на уровне одного ресторана, будет немного аккуратнее, покажу на своей домашке
onClick={() => onChange(id)} | ||
to={route} | ||
className={styles.tab} | ||
activeClassName={cn(styles.tab, { [styles.active]: id === activeId })} |
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.
activeClassName={cn(styles.tab, { [styles.active]: id === activeId })} | |
activeClassName={styles.active} |
switch (type) { | ||
case INCREMENT: | ||
return { ...state, [id]: (state[id] || 0) + 1 }; | ||
const item = state[id] || { restId, amount: 0 }; |
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.
Из данных, которые у нас лежат в редьюсере ресторанов мы можем однозначно сказать какой продукт из какого ресторана. Теперь эта информация у нас есть в двух местах, тут и в ресторанах. Так делать не стоит.
не нашел Redirect со / на ресторан |
No description provided.