This commit is contained in:
2020-10-25 14:12:53 +01:00
parent 8325759c2f
commit 15fb6f5491
6 changed files with 13 additions and 15 deletions

View File

@@ -315,7 +315,6 @@ export default function EditDish() {
className={styles.textInput}
label="Indeks glikemiczny"
placeholder="np. 70"
type="number"
value={state.glicemicIndex}
variant="outlined"
onChange={(event) =>

View File

@@ -310,7 +310,6 @@ export default function NewRestaurant() {
<TextField
className={styles.textInput}
label="Porcja"
type="number"
placeholder="np. 150g"
value={state.weight}
variant="outlined"
@@ -329,7 +328,6 @@ export default function NewRestaurant() {
className={styles.textInput}
label="Indeks glikemiczny"
placeholder="np. 70"
type="number"
value={state.glicemicIndex}
variant="outlined"
onChange={(event) =>

View File

@@ -18,12 +18,10 @@ export default function Restaurant(props) {
const showDishList = useSelector((state) => state.data.showDishList);
useEffect(() => {
if (restaurant._id !== id) {
dispatch(fetchRestaurant(id));
} else {
document.title = restaurant.name;
}
});
}, [dispatch, id]);
if (restaurant.name) document.title = restaurant.name;
return (
<div className="restaurant-container">
@@ -74,7 +72,7 @@ export default function Restaurant(props) {
<h3>Lunch menu ({restaurant.lunchHours})</h3>
)}
{!showDishList && <CircularProgress />}
{showDishList && <LunchMenu restaurant={restaurant} />}
{(showDishList && restaurant.lunchMenu) && <LunchMenu restaurant={restaurant} />}
<h3>Menu</h3>
{!showDishList && <CircularProgress />}
{showDishList && <DishList />}