web client v0.7 (edit dish / visibility / delete/ routes)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { useParams, useHistory } from "react-router-dom";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import List from "@material-ui/core/List";
|
||||
@@ -20,6 +20,7 @@ import EditRestaurantLocation from "../EditRestaurant/EditRestaurantLocation";
|
||||
import EditRestaurantMenu from "../EditRestaurant/EditRestaurantMenu";
|
||||
import EditRestaurantPhoto from "../EditRestaurant/EditRestaurantPhoto";
|
||||
import EditRestaurantSubscription from "../EditRestaurant/EditRestaurantSubscription";
|
||||
import { fetchAllDishes } from "../../actions";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
main: {
|
||||
@@ -44,6 +45,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
}));
|
||||
|
||||
export default function EditRestaurant(props) {
|
||||
const dispatch = useDispatch();
|
||||
const classes = useStyles();
|
||||
const [tab, setTab] = useState(0);
|
||||
const history = useHistory();
|
||||
@@ -67,6 +69,7 @@ export default function EditRestaurant(props) {
|
||||
badgeData.secondaryText = `Aktywna do: ${restaurant.subscriptionDue}`;
|
||||
}
|
||||
};
|
||||
dispatch(fetchAllDishes(restaurant._id));
|
||||
|
||||
const handleListItemClick = (event, index) => {
|
||||
setTab(index);
|
||||
|
||||
Reference in New Issue
Block a user