diff --git a/src/App.js b/src/App.js index f439e7c..22cbf0f 100644 --- a/src/App.js +++ b/src/App.js @@ -24,6 +24,7 @@ import EditRestaurant from "./components/Dialogs/EditRestaurant"; import NewDish from "./components/Dialogs/NewDish"; import EditDish from "./components/Dialogs/EditDish"; import Dish from "./components/Dialogs/Dish"; +import HomeScreen from "./components/Output/HomeScreen"; const theme = createMuiTheme({ palette: { @@ -57,11 +58,7 @@ function App(props) {
- - -

- Sprawdź co serwuje Twoja ulubiona restauracja. -

+
diff --git a/src/App.scss b/src/App.scss index b4d7e01..07657e1 100644 --- a/src/App.scss +++ b/src/App.scss @@ -10,6 +10,7 @@ @import "./styles/NewRestaurant.scss"; @import "./styles/EditRestaurant.scss"; @import "./styles/Dish.scss"; +@import "./styles/Home.scss"; .App { background-image: url("./public/bg_tile.jpg"); @@ -70,4 +71,4 @@ p { margin-left: 10px; margin-top: auto; margin-bottom: auto; -} +} \ No newline at end of file diff --git a/src/components/Dialogs/NewRestaurant.js b/src/components/Dialogs/NewRestaurant.js index 0c88eba..eb95974 100644 --- a/src/components/Dialogs/NewRestaurant.js +++ b/src/components/Dialogs/NewRestaurant.js @@ -24,8 +24,12 @@ import { useSelector, useDispatch } from "react-redux"; import { notification, refreshUserData } from "../../actions"; import { showBackdrop, hideBackdrop } from "../../actions/toggles.js"; import InputWorkingHours from "../Input/InputWorkingHours"; -import InputWorkingHoursSingle from "../Input/InputWorkingHoursSingle"; -import { backend } from "../../config"; +import InputLunchMenuHours from "../Input/InputLunchMenuHours"; +import { backend, restaurantTypes } from "../../config"; +import MenuItem from "@material-ui/core/MenuItem"; +import FormControl from "@material-ui/core/FormControl"; +import Select from "@material-ui/core/Select"; +import InputLabel from "@material-ui/core/InputLabel"; // ICONS import FastfoodIcon from "@material-ui/icons/Fastfood"; import LocationCityIcon from "@material-ui/icons/LocationCity"; @@ -84,6 +88,24 @@ const useStyles = makeStyles((theme) => ({ color: "#bbbbbb", }, }, + formControl: { + marginTop: theme.spacing(2), + marginBottom: theme.spacing(2), + minWidth: 100, + maxHeight: 400, + "& .MuiInputBase-root": { + color: "#bbbbbb", + }, + "$ .MuiSelect-root": { + color: "#bbbbbb", + }, + "& .MuiInputLabel-root": { + color: "#bbbbbb", + }, + }, + selectEmpty: { + marginTop: theme.spacing(2), + }, })); export default function NewRestaurant() { @@ -97,7 +119,7 @@ export default function NewRestaurant() { adress: "", coordinates: [52.354293, 19.42377], placesId: "", - type: "", + type: "polska", imgUrl: "", workingHours: { pn: "8:00 - 22:00", @@ -121,7 +143,6 @@ export default function NewRestaurant() { cityError: false, adressError: false, descriptionError: false, - typeError: false, charLeft: 400, }; const steps = ["Informacje", "Zdjęcie", "Lokalizacja"]; @@ -140,6 +161,10 @@ export default function NewRestaurant() { const history = useHistory(); const token = useSelector((state) => state.data.userData.jwt); + const availableTypes = restaurantTypes.map((type) => { + return {type} + }); + // HANDLERS const sendForm = () => { @@ -244,7 +269,6 @@ export default function NewRestaurant() { nameValid: validator.isLength(state.name, { min: 1, max: 40 }), cityValid: validator.isLength(state.city, { min: 1, max: 40 }), adressValid: validator.isLength(state.name, { min: 1, max: 40 }), - typeValid: validator.isLength(state.type, { min: 1, max: 40 }), descriptionValid: validator.isLength(state.description, { min: 1, max: 400, @@ -254,7 +278,6 @@ export default function NewRestaurant() { ...state, nameError: !validation.nameValid, cityError: !validation.cityValid, - typeError: !validation.typeValid, adressError: !validation.adressValid, descriptionError: !validation.descriptionValid, }); @@ -263,8 +286,7 @@ export default function NewRestaurant() { validation.nameValid && validation.cityValid && validation.adressValid && - validation.descriptionValid && - validation.typeValid + validation.descriptionValid ); }; @@ -320,25 +342,23 @@ export default function NewRestaurant() { />
- + Kuchnia + +
- setLunchHours(value)} day="Lunch hours" />
+ setLunchHours(value)}/>
({ textInput: { @@ -53,6 +56,24 @@ const useStyles = makeStyles((theme) => ({ link: { cursor: "pointer", }, + formControl: { + marginTop: theme.spacing(2), + marginBottom: theme.spacing(2), + minWidth: 100, + maxHeight: 400, + "& .MuiInputBase-root": { + color: "#bbbbbb", + }, + "$ .MuiSelect-root": { + color: "#bbbbbb", + }, + "& .MuiInputLabel-root": { + color: "#bbbbbb", + }, + }, + selectEmpty: { + marginTop: theme.spacing(2), + }, })); const calculateCharLeft = (from) => { @@ -130,6 +151,10 @@ export default function EditRestaurantInfo(props) { ); }; + const availableTypes = restaurantTypes.map((type) => { + return {type} + }); + const cancelChanges = () => { setState(initialState); }; @@ -243,28 +268,24 @@ export default function EditRestaurantInfo(props) { />
- - setState({ ...state, type: event.target.value }) - } - InputLabelProps={{ shrink: true }} - InputProps={{ - startAdornment: ( - - - - ), - }} - label="Kuchnia" - placeholder="np. Meksykańska" - variant="outlined" - /> + + Kuchnia + +
- setState({ ...state, workingHours: hours })} hours={state.workingHours} /> -
-
- setLunchHours(value)} day="Lunch hours" />
-

Dane kontaktowe

@@ -427,9 +444,9 @@ export default function EditRestaurantInfo(props) {

Lunch menu

setState({ ...state, lunchHours: value })} + changeValue={setLunchHours} />
diff --git a/src/components/Input/InputLunchMenuHours.js b/src/components/Input/InputLunchMenuHours.js index c535c75..01e4daa 100644 --- a/src/components/Input/InputLunchMenuHours.js +++ b/src/components/Input/InputLunchMenuHours.js @@ -27,17 +27,17 @@ export default function InputWorkingHoursSingle(props) { props.changeValue(event.target.value); }; const handleCheckbox = () => { - if (!props.off) { + if (!props.nieczynne) { props.changeValue(""); } else { - props.changeValue("13:00 - 15:00"); + props.changeValue("12:30 - 13:30"); } }; const classes = useStyles(); return (
-
Lunch menu
+
Lunch hours
+ } - label="Wyłącz" + label="Brak" />
); diff --git a/src/components/Output/HomeScreen.js b/src/components/Output/HomeScreen.js new file mode 100644 index 0000000..31f3d4f --- /dev/null +++ b/src/components/Output/HomeScreen.js @@ -0,0 +1,29 @@ +import React from 'react'; +import LogoMain from "../Output/logoMain"; +import SearchPanel from "../Input/SearchPanel"; +import HelpIcon from '@material-ui/icons/Help'; +import appstore from "../../public/appstore.png"; +import googleplay from "../../public/googleplay.png"; + +export default function HomeScreen() { + return
+
+
Dowiedz się czym właściwie jest Menui
+
+
+
+ + +

+ Sprawdź co serwuje Twoja ulubiona restauracja. +

+
+
+

Pobierz na telefon

+
+ Get Menui from App Store + Get Menui from Google Play +
+
+
+} \ No newline at end of file diff --git a/src/config.js b/src/config.js index ec759a4..a59ed40 100644 --- a/src/config.js +++ b/src/config.js @@ -1 +1,37 @@ export const backend = "https://menui.azurewebsites.net/"; + +export const restaurantTypes = [ + "afrykańska", + "arabska", + "bałkańska", + "belgijska", + "brytyjska", + "chińska", + "chorwacka", + "czeska", + "dietetyczna", + "francuska", + "grecka", + "gruzińska", + "hiszpańska", + "indyjska", + "irlandzka", + "japońska", + "koreańska", + "koszerna", + "meksykańska", + "międzynarodowa", + "polska", + "rosyjska", + "skandynawska", + "śródziemnomorska", + "tajska", + "turecka", + "ukraińska", + "węgierska", + "wietnamska", + "włoska", + "żydowska", + "mieszane", + "inna", + ]; \ No newline at end of file diff --git a/src/index.js b/src/index.js index e3990e0..67be22c 100644 --- a/src/index.js +++ b/src/index.js @@ -20,7 +20,7 @@ const store = createStore( rootReducer(history), compose( applyMiddleware(routerMiddleware(history), thunk), - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() + window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() : f => f ) ); diff --git a/src/public/appstore.png b/src/public/appstore.png new file mode 100644 index 0000000..b2e3db7 Binary files /dev/null and b/src/public/appstore.png differ diff --git a/src/public/googleplay.png b/src/public/googleplay.png new file mode 100644 index 0000000..5be08a5 Binary files /dev/null and b/src/public/googleplay.png differ diff --git a/src/styles/Home.scss b/src/styles/Home.scss new file mode 100644 index 0000000..eb4e47f --- /dev/null +++ b/src/styles/Home.scss @@ -0,0 +1,36 @@ +.hs { + height: 100%; + display: flex; + flex-flow: column; + justify-content: space-around; + align-items: center; +} + +.hs-top { + display: flex; + cursor: pointer; + width: fit-content; + justify-content: center; + background-color: rgba(0, 0, 0, 0.315); + color: rgb(184, 184, 184); + border-radius: 8px; + h5 { + font-weight: 500; + margin-left: 18px; + } + transition: background-color 0.2s; +} + +.hs-top:hover { + background-color: rgba(71, 71, 71, 0.315); +} + +.hs-top-icon { + margin: 18px; +} + +.hs-bottom-icon { + height: 3rem; + margin: 10px; + cursor: pointer; +}