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

Feature/ht6 #81

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

Conversation

dmitrykhotko
Copy link

No description provided.

@@ -36,10 +36,22 @@ function Restaurants({ restaurants, loading, loaded, loadRestaurants }) {
))}
</div>
<Switch>
<Route path="/restaurants/:restId/menu">
Copy link
Owner

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 })}
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
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 };
Copy link
Owner

Choose a reason for hiding this comment

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

Из данных, которые у нас лежат в редьюсере ресторанов мы можем однозначно сказать какой продукт из какого ресторана. Теперь эта информация у нас есть в двух местах, тут и в ресторанах. Так делать не стоит.

@koretskiyav
Copy link
Owner

не нашел Redirect со / на ресторан

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