diff --git a/package-lock.json b/package-lock.json index 9f66665..0663afc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9094,9 +9094,9 @@ } }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-gyp": { "version": "3.8.0", @@ -12177,11 +12177,11 @@ "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=" }, "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz", + "integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==", "requires": { - "node-forge": "0.9.0" + "node-forge": "^0.10.0" } }, "semver": { diff --git a/src/components/Output/CardDish.js b/src/components/Output/CardDish.js index 6223349..0769c79 100644 --- a/src/components/Output/CardDish.js +++ b/src/components/Output/CardDish.js @@ -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 ( -
+
history.push(`/dish/${_id}`)} + >

{name}

Porcja: {weight}

+

+ {vegan && "Danie wegańskie "} + {vegetarian && "Danie wegetariańskie"} +

-
{price} zł
+
{!props.hidePrice && `${price} zł`}
+
); diff --git a/src/components/Output/DishesCategory.js b/src/components/Output/DishesCategory.js index 1e25f41..1fa9226 100644 --- a/src/components/Output/DishesCategory.js +++ b/src/components/Output/DishesCategory.js @@ -23,7 +23,7 @@ export default function DishesCategory(props) { const dishCards = dishes.map((dish) => { return ( - + ); }); @@ -33,7 +33,9 @@ export default function DishesCategory(props) { } > -

{props.name}

+

+ {props.name} {props.price && `(${props.price}zł)`} +

{dishCards} diff --git a/src/components/Output/Footer.js b/src/components/Output/Footer.js index ef6511c..9e17017 100644 --- a/src/components/Output/Footer.js +++ b/src/components/Output/Footer.js @@ -4,7 +4,7 @@ export default class Footer extends React.Component { render() { return (
-

Bankai Software 2020

+

Bankai Software 2020 (wersja testowa aplikacji)

); } diff --git a/src/components/Output/LunchMenu.js b/src/components/Output/LunchMenu.js new file mode 100644 index 0000000..1635edb --- /dev/null +++ b/src/components/Output/LunchMenu.js @@ -0,0 +1,32 @@ +import React from "react"; +import DishesCategory from "./DishesCategory"; +import { useSelector } from "react-redux"; + +export default function LunchMenu(props) { + const dishlist = useSelector((state) => state.dishes); + const { restaurant } = props; + const lunchMenu = restaurant.lunchMenu; + function filterDishes(dishes, set) { + var result = []; + dishes.map((dish) => { + if (set.lunchSetDishes.includes(dish._id)) { + result.push(dish); + } + return true; + }); + return result; + } + const sets = lunchMenu.map((set) => { + return ( + + ); + }); + + return
{sets}
; +} diff --git a/src/components/Output/Pictograms.js b/src/components/Output/Pictograms.js index f657519..2ad237a 100644 --- a/src/components/Output/Pictograms.js +++ b/src/components/Output/Pictograms.js @@ -1,4 +1,5 @@ import React from "react"; +import Tooltip from "@material-ui/core/Tooltip"; // ICONS import alcohol from "../../public/i_alcohol.svg"; import card from "../../public/i_card.svg"; @@ -18,12 +19,14 @@ import vegetarian from "../../public/i_vegetarian.svg"; export default function (props) { const pictograms = props.pictograms.map((pictogram, index) => ( - {pictogram} + + {pictogram} + )); return
{pictograms}
; @@ -65,3 +68,40 @@ function getImage(name) { return card; } } + +function getTooltip(name) { + switch (name) { + case "alcohol": + return "Serwujemy alkohol"; + case "cardPayments": + return "Zapłacisz kartą"; + case "delivery": + return "Dowozimy"; + case "eggs": + return "Jaja"; + case "gluten": + return "Gluten"; + case "glutenFree": + return "Bezglutenowe"; + case "lactose": + return "Laktoza"; + case "lactoseFree": + return "Bez laktozy"; + case "peanuts": + return "Orzechy"; + case "petFriendly": + return "Lubimy zwierzęta"; + case "seaFood": + return "Owoce morza"; + case "sesame": + return "Sezam"; + case "soy": + return "Soja"; + case "vegan": + return "Wegańskie"; + case "vegetarian": + return "Wegetariańskie"; + default: + return "Podpowiedź"; + } +} diff --git a/src/components/Output/Restaurant.js b/src/components/Output/Restaurant.js index e4b27d1..f676417 100644 --- a/src/components/Output/Restaurant.js +++ b/src/components/Output/Restaurant.js @@ -8,6 +8,8 @@ import { useSelector, useDispatch } from "react-redux"; import { fetchRestaurant } from "../../actions"; import GoogleMapStatic from "./GoogleMapStatic"; import WorkingHours from "./WorkingHours"; +import Social from "./Social"; +import LunchMenu from "./LunchMenu"; export default function Restaurant(props) { const restaurant = useSelector((state) => state.restaurant); @@ -51,6 +53,13 @@ export default function Restaurant(props) { {restaurant.phone}

)} + {restaurant.links && ( + + )}
Lokalizacja
@@ -61,6 +70,11 @@ export default function Restaurant(props) {
+ {restaurant.lunchHours && ( +

Lunch menu ({restaurant.lunchHours})

+ )} + {showDishList === false && } + {showDishList === true && }

Menu

{showDishList === false && } {showDishList === true && } @@ -69,9 +83,3 @@ export default function Restaurant(props) {
); } - -// - -/* {restaurant.location !== undefined && ( - -)} */ diff --git a/src/components/Output/Social.js b/src/components/Output/Social.js index b845df8..34f6d4a 100644 --- a/src/components/Output/Social.js +++ b/src/components/Output/Social.js @@ -3,29 +3,41 @@ import FacebookIcon from "@material-ui/icons/Facebook"; import TwitterIcon from "@material-ui/icons/Twitter"; import InstagramIcon from "@material-ui/icons/Instagram"; import IconButton from "@material-ui/core/IconButton"; +import LanguageIcon from "@material-ui/icons/Language"; import { openInNewTab } from "../../Services.js"; export default function Social(props) { return (
- openInNewTab("https://www.facebook.com")} - color="secondary" - > - - - openInNewTab("https://twitter.com/menuifood")} - color="secondary" - > - - - openInNewTab("https://www.instagram.com")} - color="secondary" - > - - + {props.facebook && ( + openInNewTab(props.facebook)} + color="secondary" + > + + + )} + {props.twitter && ( + openInNewTab(props.twitter)} + color="secondary" + > + + + )} + {props.instagram && ( + openInNewTab(props.instagram)} + color="secondary" + > + + + )} + {props.www && ( + openInNewTab(props.www)} color="secondary"> + + + )}
); } diff --git a/src/components/Output/WorkingHours.js b/src/components/Output/WorkingHours.js index 3a5b3d6..3fd877a 100644 --- a/src/components/Output/WorkingHours.js +++ b/src/components/Output/WorkingHours.js @@ -7,48 +7,26 @@ export default function WorkingHours(props) { {hours && (
Godziny otwarcia
-

- Pn:{" "} - - {hours.pn ? hours.pn : "Nieczynne"} - -

-

- Wt:{" "} - - {hours.wt ? hours.wt : "Nieczynne"} - -

-

- Śr:{" "} - - {hours.sr ? hours.sr : "Nieczynne"} - -

-

- Czw:{" "} - - {hours.cz ? hours.cz : "Nieczynne"} - -

-

- Pt:{" "} - - {hours.pt ? hours.pt : "Nieczynne"} - -

-

- So:{" "} - - {hours.sb ? hours.sb : "Nieczynne"} - -

-

- Nie:{" "} - - {hours.nd ? hours.nd : "Nieczynne"} - -

+
+
+

Pn:

+

Wt:

+

Śr:

+

Czw:

+

Pt:

+

Sb:

+

Nd:

+
+
+

{hours.pn ? hours.pn : "Nieczynne"}

+

{hours.wt ? hours.wt : "Nieczynne"}

+

{hours.sr ? hours.sr : "Nieczynne"}

+

{hours.cz ? hours.cz : "Nieczynne"}

+

{hours.pt ? hours.pt : "Nieczynne"}

+

{hours.sb ? hours.sb : "Nieczynne"}

+

{hours.nd ? hours.nd : "Nieczynne"}

+
+
)}
diff --git a/src/components/TopBar.js b/src/components/TopBar.js index 413482b..ae3e6ed 100644 --- a/src/components/TopBar.js +++ b/src/components/TopBar.js @@ -95,7 +95,7 @@ export default function TopBar() { onClick={() => history.push("/")} />
-
Food guide
+
Food guide (wersja testowa)
{loggedIn && ( @@ -167,7 +167,11 @@ export default function TopBar() { /> )}
- + diff --git a/src/styles/DishList.scss b/src/styles/DishList.scss index 6e19778..27ba3f7 100644 --- a/src/styles/DishList.scss +++ b/src/styles/DishList.scss @@ -54,10 +54,14 @@ h4 { } .carddish-right { + display: flex; + flex-direction: column; + margin-right: 1rem; + align-items: flex-end; + justify-content: space-between; h5 { font-weight: 500; font-size: 1rem; - margin-top: 1rem; - margin-right: 1rem; + margin-top: 4px; } } diff --git a/src/styles/Restaurant.scss b/src/styles/Restaurant.scss index 37b5b99..a36b072 100644 --- a/src/styles/Restaurant.scss +++ b/src/styles/Restaurant.scss @@ -52,7 +52,7 @@ .restaurant-dishes { min-width: 80%; h3 { - font-size: 1.2rem; + font-size: 1rem; font-weight: 400; } } @@ -88,3 +88,22 @@ font-weight: 400; color: $gray; } + +.hours { + display: flex; +} + +.hours-left { + margin-left: auto; + text-align: right; +} + +.hours-right { + text-align: left; + + margin-right: auto; + p { + font-weight: 400; + color: $gray; + } +}