web client v0.6 (add dish)

This commit is contained in:
2020-09-30 21:57:51 +02:00
parent 6391c99d07
commit e242e01320
13 changed files with 899 additions and 64 deletions

View File

@@ -53,6 +53,8 @@ export default function EditRestaurant(props) {
color: "",
secondaryText: "",
};
const restaurant = restaurants.find(matchId);
if (restaurant === undefined) history.push("/");
const badgeInit = () => {
if (
!restaurant.subscriptionActive ||
@@ -73,8 +75,6 @@ export default function EditRestaurant(props) {
function matchId(element) {
return element._id === id;
}
const restaurant = restaurants.find(matchId);
if (restaurant === undefined) history.push("/");
badgeInit();
return (
@@ -153,7 +153,10 @@ export default function EditRestaurant(props) {
</ListItemIcon>
<ListItemText primary="Menu" />
</ListItem>
<ListItem button>
<ListItem
button
onClick={() => history.push(`/newDish/${restaurant._id}`)}
>
<ListItemIcon>
<AddIcon color="primary" />
</ListItemIcon>