web client v0.4 (edit restaurant info)
This commit is contained in:
@@ -22,6 +22,7 @@ import InfoDialog from "../Output/InfoDialog";
|
||||
import { prepareTags } from "../../Services.js";
|
||||
import axios from "axios";
|
||||
import { useSelector } from "react-redux";
|
||||
import InputWorkingHours from "../Input/InputWorkingHours";
|
||||
// ICONS
|
||||
import FastfoodIcon from "@material-ui/icons/Fastfood";
|
||||
import LocationCityIcon from "@material-ui/icons/LocationCity";
|
||||
@@ -35,9 +36,11 @@ import ButtonPrimary from "../Input/ButtonPrimary";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
margin: "auto",
|
||||
textAlign: "center",
|
||||
maxHeight: "700px",
|
||||
"& .MuiPaper-root": {
|
||||
minWidth: "30%",
|
||||
width: "auto",
|
||||
backgroundColor: "#262626",
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
@@ -70,15 +73,6 @@ const useStyles = makeStyles((theme) => ({
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
},
|
||||
timePicker: {
|
||||
margin: theme.spacing(2),
|
||||
"& .MuiInputBase-root": {
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
"& .MuiInputLabel-root": {
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
},
|
||||
stepLabel: {
|
||||
"& .MuiStepLabel-label": {
|
||||
color: "#bbbbbb",
|
||||
@@ -97,14 +91,23 @@ export default function NewRestaurant() {
|
||||
coordinates: [52.354293, 19.42377],
|
||||
placesId: "",
|
||||
imgURL: "",
|
||||
hoursFrom: "07:00",
|
||||
hoursTo: "23:00",
|
||||
workingHours: {
|
||||
pn: "8:00 - 22:00",
|
||||
wt: "8:00 - 22:00",
|
||||
sr: "8:00 - 22:00",
|
||||
cz: "8:00 - 22:00",
|
||||
pt: "8:00 - 22:00",
|
||||
sb: "8:00 - 22:00",
|
||||
nd: "8:00 - 22:00",
|
||||
},
|
||||
description: "",
|
||||
tags: [],
|
||||
phone: "",
|
||||
facebook: "",
|
||||
instagram: "",
|
||||
www: "",
|
||||
links: {
|
||||
facebook: "",
|
||||
instagram: "",
|
||||
www: "",
|
||||
},
|
||||
nameError: false,
|
||||
cityError: false,
|
||||
adressError: false,
|
||||
@@ -141,12 +144,10 @@ export default function NewRestaurant() {
|
||||
coordinates: state.coordinates,
|
||||
placesId: state.placesId,
|
||||
imgURL: state.imgURL,
|
||||
workingHours: `${state.hoursFrom} - ${state.hoursTo}`,
|
||||
workingHours: state.workingHours,
|
||||
description: state.description,
|
||||
tags: formattedTags,
|
||||
facebook: state.facebook,
|
||||
instagram: state.instagram,
|
||||
www: state.www,
|
||||
links: state.links,
|
||||
phone: state.phone,
|
||||
hidden: false,
|
||||
};
|
||||
@@ -345,37 +346,11 @@ export default function NewRestaurant() {
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
label="Otwarcie"
|
||||
type="time"
|
||||
onChange={(event) =>
|
||||
setState({ ...state, hoursFrom: event.target.value })
|
||||
<InputWorkingHours
|
||||
hours={state.workingHours}
|
||||
setHours={(hours) =>
|
||||
setState({ ...state, workingHours: hours })
|
||||
}
|
||||
variant="outlined"
|
||||
value={state.hoursFrom}
|
||||
className={styles.timePicker}
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
inputProps={{
|
||||
step: 300, // 5 min
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
label="Zamknięcie"
|
||||
type="time"
|
||||
onChange={(event) =>
|
||||
setState({ ...state, hoursTo: event.target.value })
|
||||
}
|
||||
variant="outlined"
|
||||
value={state.hoursTo}
|
||||
className={styles.timePicker}
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
inputProps={{
|
||||
step: 300, // 5 min
|
||||
}}
|
||||
/>
|
||||
<div className="newRestaurant-content-fullwidth">
|
||||
<TextField
|
||||
@@ -434,9 +409,12 @@ export default function NewRestaurant() {
|
||||
className={styles.textInput}
|
||||
label="Facebook"
|
||||
variant="outlined"
|
||||
value={state.facebook}
|
||||
value={state.links.facebook}
|
||||
onChange={(event) =>
|
||||
setState({ ...state, facebook: event.target.value })
|
||||
setState({
|
||||
...state,
|
||||
links: { ...state.links, facebook: event.target.value },
|
||||
})
|
||||
}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
@@ -450,9 +428,12 @@ export default function NewRestaurant() {
|
||||
className={styles.textInput}
|
||||
label="Instagram"
|
||||
variant="outlined"
|
||||
value={state.instagram}
|
||||
value={state.links.instagram}
|
||||
onChange={(event) =>
|
||||
setState({ ...state, instagram: event.target.value })
|
||||
setState({
|
||||
...state,
|
||||
links: { ...state.links, instagram: event.target.value },
|
||||
})
|
||||
}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
@@ -466,9 +447,12 @@ export default function NewRestaurant() {
|
||||
className={styles.textInput}
|
||||
label="www"
|
||||
variant="outlined"
|
||||
value={state.www}
|
||||
value={state.links.www}
|
||||
onChange={(event) =>
|
||||
setState({ ...state, www: event.target.value })
|
||||
setState({
|
||||
...state,
|
||||
links: { ...state.links, www: event.target.value },
|
||||
})
|
||||
}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
@@ -505,13 +489,15 @@ export default function NewRestaurant() {
|
||||
/>
|
||||
</Paper>
|
||||
)}
|
||||
{activeStep !== 0 && (
|
||||
<ButtonPrimary onClick={handlePreviousButton} text="Cofnij" />
|
||||
)}
|
||||
<ButtonSecondary
|
||||
onClick={handleNextButton}
|
||||
text={activeStep === 2 ? "Dodaj lokal" : "Dalej"}
|
||||
/>
|
||||
<div className="newRestaurant-bottom">
|
||||
{activeStep !== 0 && (
|
||||
<ButtonPrimary onClick={handlePreviousButton} text="Cofnij" />
|
||||
)}
|
||||
<ButtonSecondary
|
||||
onClick={handleNextButton}
|
||||
text={activeStep === 2 ? "Dodaj lokal" : "Dalej"}
|
||||
/>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user