diff --git a/src/App.js b/src/App.js
index 6039327..2d7c013 100644
--- a/src/App.js
+++ b/src/App.js
@@ -5,6 +5,7 @@ import LogoMain from "./components/logoMain";
import Footer from "./components/Footer";
import SearchPanel from "./components/SearchPanel";
import SearchResults from "./components/SearchResults";
+import Restaurant from "./components/Restaurant";
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import { useSelector } from "react-redux";
@@ -25,13 +26,16 @@ function App() {
-
+ {(appMode === "init" || appMode === "search results") && (
+
+ )}
{appMode === "init" && (
Sprawdź co serwuje Twoja ulubiona restauracja.
)}
{appMode === "search results" &&
}
+ {appMode === "restaurant" &&
}
-
+
dispatch(fetchRestaurant(props.id))}
+ className="card-restaurant"
+ >
+
{props.name}
@@ -13,26 +34,10 @@ export default function CardRestaurant(props) {
Godziny otwarcia: {props.hours}
-
- Jakiś krótki opis restauracji. Coś tam że jest przytulnie i
- elegancko.
-
+
{props.description}
diff --git a/src/components/Pictograms.js b/src/components/Pictograms.js
index f4b2535..0b80671 100644
--- a/src/components/Pictograms.js
+++ b/src/components/Pictograms.js
@@ -20,7 +20,7 @@ function getImage(name) {
switch (name) {
case "alcohol":
return alcohol;
- case "card":
+ case "cardPayments":
return card;
case "delivery":
return delivery;
@@ -36,7 +36,7 @@ function getImage(name) {
return lactoseFree;
case "peanuts":
return peanuts;
- case "pets":
+ case "petFriendly":
return pets;
case "seaFood":
return seaFood;
@@ -49,13 +49,18 @@ function getImage(name) {
case "vegetarian":
return vegetarian;
default:
- return false;
+ return card;
}
}
export default function (props) {
- const pictograms = props.pictograms.map((pictogram) => (
-
})
+ const pictograms = props.pictograms.map((pictogram, index) => (
+
})
));
return
{pictograms}
;
diff --git a/src/components/Restaurant.js b/src/components/Restaurant.js
new file mode 100644
index 0000000..e43be08
--- /dev/null
+++ b/src/components/Restaurant.js
@@ -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 (
+
+
+
{restaurant.name}
+
{restaurant.city}
+
+
+ );
+}
diff --git a/src/components/SearchResults.js b/src/components/SearchResults.js
index f86d50a..9aee1cb 100644
--- a/src/components/SearchResults.js
+++ b/src/components/SearchResults.js
@@ -7,15 +7,16 @@ export default function SearchResults() {
const array = Array.from(results);
var count = results.length;
const restaurants = array.map((restaurant) => (
-
-
-
+
));
return (
@@ -24,7 +25,7 @@ export default function SearchResults() {
Znaleziono: {count}
-