web client changfed

This commit is contained in:
2020-10-06 22:03:53 +02:00
parent 06728d32f1
commit becf66a5fa
12 changed files with 202 additions and 92 deletions

View File

@@ -1,21 +1,27 @@
import React from "react";
import Pictograms from "./Pictograms";
import { extractTags } from "../../Services";
import { useHistory } from "react-router-dom";
import KeyboardArrowRightIcon from "@material-ui/icons/KeyboardArrowRight";
export default function CardDish(props) {
const history = useHistory();
const {
name,
price,
imgUrl,
//notes,
weight,
//vegan,
//vegetarian,
vegan,
vegetarian,
allergens,
_id,
} = props.dish;
return (
<div className="carddish-container">
<div
className="carddish-container"
onClick={() => history.push(`/dish/${_id}`)}
>
<div className="carddish-left">
<div
className="carddish-img"
@@ -25,12 +31,17 @@ export default function CardDish(props) {
<div className="carddish-left-upper">
<h2>{name}</h2>
<p>Porcja: {weight}</p>
<p>
{vegan && "Danie wegańskie "}
{vegetarian && "Danie wegetariańskie"}
</p>
</div>
<Pictograms pictograms={extractTags(allergens)} />
</div>
</div>
<div className="carddish-right">
<h5>{price} </h5>
<h5>{!props.hidePrice && `${price}`}</h5>
<KeyboardArrowRightIcon color="primary" />
</div>
</div>
);