new look / search list / restaurant view

This commit is contained in:
2020-07-24 20:27:05 +02:00
parent 2ab445670e
commit ad2a945965
14 changed files with 208 additions and 44 deletions

View File

@@ -0,0 +1,32 @@
import React from "react";
import Pictograms from "./Pictograms";
import { useSelector } from "react-redux";
export default function Restaurant(props) {
const restaurant = useSelector((state) => state.restaurant);
function extractTags(tags) {
var results = [];
for (let [key, value] of Object.entries(tags)) {
if (value === true) {
results.push(key);
}
}
return results;
}
return (
<div className="restaurant-container">
<div
className="restaurant-hero"
style={{ backgroundImage: "url(" + restaurant.imgUrl + ")" }}
>
<div className="restaurant-pictograms">
<Pictograms pictograms={extractTags(restaurant.tags)} />
</div>
</div>
<h1>{restaurant.name}</h1>
<p>{restaurant.city}</p>
<hr />
</div>
);
}