web client v0.2 (add restaurant OK, settings OK)

This commit is contained in:
2020-09-19 18:16:26 +02:00
parent 732ad74657
commit 68ecf13aa1
16 changed files with 546 additions and 86 deletions

View File

@@ -0,0 +1,50 @@
import React from "react";
import PictogramsSeparate from "../Output/PictogramsSeparate";
import DishList from "../Output/DishList";
import CircularProgress from "@material-ui/core/CircularProgress";
import { extractTags } from "../../Services";
import { useSelector } from "react-redux";
export default function EditRestaurant(props) {
const restaurant = useSelector((state) => state.restaurant);
const showDishList = useSelector((state) => state.data.showDishList);
return (
<div className="restaurant-container">
<div className="restaurant-content">
<div className="restaurant-info">
<div
className="restaurant-hero"
style={{ backgroundImage: "url(" + restaurant.imgUrl + ")" }}
></div>
<h1>{restaurant.name}</h1>
<p>{restaurant.description}</p>
<hr />
<p>
Miejscowość:{" "}
<span className="restaurant-span">{restaurant.city}</span>
</p>
<p>
Godziny pracy:{" "}
<span className="restaurant-span">{restaurant.workingHours}</span>
</p>
{restaurant.phone && (
<p>
Kontakt:{" "}
<span className="restaurant-span">{restaurant.phone}</span>
</p>
)}
<hr />
<div className="restaurant-pictograms">
<PictogramsSeparate pictograms={extractTags(restaurant.tags)} />
</div>
</div>
<div className="restaurant-dishes">
<h3>Menu</h3>
{showDishList === false && <CircularProgress />}
{showDishList === true && <DishList />}
</div>
</div>
</div>
);
}