web client changfed
This commit is contained in:
@@ -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} zł</h5>
|
||||
<h5>{!props.hidePrice && `${price} zł`}</h5>
|
||||
<KeyboardArrowRightIcon color="primary" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user