New favicon
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.4 KiB |
@@ -16,6 +16,7 @@ import StepLabel from "@material-ui/core/StepLabel";
|
|||||||
import Paper from "@material-ui/core/Paper";
|
import Paper from "@material-ui/core/Paper";
|
||||||
import Autocomplete from "@material-ui/lab/Autocomplete";
|
import Autocomplete from "@material-ui/lab/Autocomplete";
|
||||||
import InputAdornment from "@material-ui/core/InputAdornment";
|
import InputAdornment from "@material-ui/core/InputAdornment";
|
||||||
|
import validator from "validator";
|
||||||
// ICONS
|
// ICONS
|
||||||
import FastfoodIcon from "@material-ui/icons/Fastfood";
|
import FastfoodIcon from "@material-ui/icons/Fastfood";
|
||||||
import LocationCityIcon from "@material-ui/icons/LocationCity";
|
import LocationCityIcon from "@material-ui/icons/LocationCity";
|
||||||
@@ -23,6 +24,9 @@ import PhoneIcon from "@material-ui/icons/Phone";
|
|||||||
import FacebookIcon from "@material-ui/icons/Facebook";
|
import FacebookIcon from "@material-ui/icons/Facebook";
|
||||||
import TwitterIcon from "@material-ui/icons/Twitter";
|
import TwitterIcon from "@material-ui/icons/Twitter";
|
||||||
import LanguageIcon from "@material-ui/icons/Language";
|
import LanguageIcon from "@material-ui/icons/Language";
|
||||||
|
import ButtonPrimary from "../Input/ButtonPrimary";
|
||||||
|
|
||||||
|
// SETUP
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -81,9 +85,15 @@ export default function NewRestaurant() {
|
|||||||
const initialState = {
|
const initialState = {
|
||||||
name: "",
|
name: "",
|
||||||
city: "",
|
city: "",
|
||||||
|
adress: "",
|
||||||
hoursFrom: "",
|
hoursFrom: "",
|
||||||
hoursTo: "",
|
hoursTo: "",
|
||||||
description: "",
|
description: "",
|
||||||
|
tags: [],
|
||||||
|
phone: "",
|
||||||
|
facebook: "",
|
||||||
|
twitter: "",
|
||||||
|
www: "",
|
||||||
};
|
};
|
||||||
const steps = ["Informacje", "Zdjęcie", "Lokalizacja"];
|
const steps = ["Informacje", "Zdjęcie", "Lokalizacja"];
|
||||||
const [state, setState] = useState(initialState);
|
const [state, setState] = useState(initialState);
|
||||||
@@ -101,6 +111,22 @@ export default function NewRestaurant() {
|
|||||||
"Dowozimy",
|
"Dowozimy",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// HANDLERS
|
||||||
|
|
||||||
|
const handleNextButton = () => {
|
||||||
|
if (activeStep < 2) {
|
||||||
|
setActiveStep(activeStep + 1);
|
||||||
|
console.log(activeStep);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePreviousButton = () => {
|
||||||
|
setActiveStep(activeStep - 1);
|
||||||
|
console.log(activeStep);
|
||||||
|
};
|
||||||
|
|
||||||
|
// COMPONENTS
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Dialog
|
<Dialog
|
||||||
@@ -125,16 +151,17 @@ export default function NewRestaurant() {
|
|||||||
</Step>
|
</Step>
|
||||||
))}
|
))}
|
||||||
</Stepper>
|
</Stepper>
|
||||||
|
|
||||||
|
{activeStep === 0 && (
|
||||||
<Paper variant="outlined">
|
<Paper variant="outlined">
|
||||||
<div className="newRestaurant-content">
|
<div className="newRestaurant-content-fullwidth">
|
||||||
<TextField
|
<TextField
|
||||||
className={styles.textInput}
|
className={styles.textInputFullWidth}
|
||||||
|
fullWidth
|
||||||
required
|
required
|
||||||
label="Nazwa lokalu"
|
label="Nazwa lokalu"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.name = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
|
||||||
}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -143,14 +170,28 @@ export default function NewRestaurant() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="newRestaurant-content">
|
||||||
<TextField
|
<TextField
|
||||||
className={styles.textInput}
|
className={styles.textInput}
|
||||||
required
|
required
|
||||||
label="Miasto"
|
label="Miasto"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.city = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
InputProps={{
|
||||||
}
|
startAdornment: (
|
||||||
|
<InputAdornment position="start">
|
||||||
|
<LocationCityIcon color="primary" />
|
||||||
|
</InputAdornment>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
className={styles.textInput}
|
||||||
|
required
|
||||||
|
label="Adres"
|
||||||
|
variant="outlined"
|
||||||
|
onChange={(event) => (state.adress = event.target.value)}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -192,6 +233,9 @@ export default function NewRestaurant() {
|
|||||||
className={styles.textInputFullWidth}
|
className={styles.textInputFullWidth}
|
||||||
fullWidth
|
fullWidth
|
||||||
label="Opis"
|
label="Opis"
|
||||||
|
onChange={(event) =>
|
||||||
|
(state.description = event.target.value)
|
||||||
|
}
|
||||||
multiline
|
multiline
|
||||||
rows={3}
|
rows={3}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -199,6 +243,9 @@ export default function NewRestaurant() {
|
|||||||
<Autocomplete
|
<Autocomplete
|
||||||
multiple
|
multiple
|
||||||
options={availableTags}
|
options={availableTags}
|
||||||
|
onChange={(event, values) =>
|
||||||
|
setState({ ...state, tags: values })
|
||||||
|
}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
{...params}
|
{...params}
|
||||||
@@ -213,10 +260,9 @@ export default function NewRestaurant() {
|
|||||||
<TextField
|
<TextField
|
||||||
className={styles.textInput}
|
className={styles.textInput}
|
||||||
label="Telefon"
|
label="Telefon"
|
||||||
|
type="tel"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.phone = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
|
||||||
}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -229,9 +275,7 @@ export default function NewRestaurant() {
|
|||||||
className={styles.textInput}
|
className={styles.textInput}
|
||||||
label="Facebook"
|
label="Facebook"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.facebook = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
|
||||||
}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -244,9 +288,7 @@ export default function NewRestaurant() {
|
|||||||
className={styles.textInput}
|
className={styles.textInput}
|
||||||
label="Twitter"
|
label="Twitter"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.twitter = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
|
||||||
}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -259,9 +301,7 @@ export default function NewRestaurant() {
|
|||||||
className={styles.textInput}
|
className={styles.textInput}
|
||||||
label="www"
|
label="www"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={(event) =>
|
onChange={(event) => (state.www = event.target.value)}
|
||||||
(state.restaurantName = event.target.value)
|
|
||||||
}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<InputAdornment position="start">
|
<InputAdornment position="start">
|
||||||
@@ -272,7 +312,14 @@ export default function NewRestaurant() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Paper>
|
</Paper>
|
||||||
<ButtonSecondary text={activeStep === 2 ? "Dodaj lokal" : "Dalej"} />
|
)}
|
||||||
|
{activeStep !== 0 && (
|
||||||
|
<ButtonPrimary onClick={handlePreviousButton} text="Cofnij" />
|
||||||
|
)}
|
||||||
|
<ButtonSecondary
|
||||||
|
onClick={handleNextButton}
|
||||||
|
text={activeStep === 2 ? "Dodaj lokal" : "Dalej"}
|
||||||
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ import Button from "@material-ui/core/Button";
|
|||||||
|
|
||||||
const StyledButton = withStyles({
|
const StyledButton = withStyles({
|
||||||
root: {
|
root: {
|
||||||
background: "none",
|
backgroundColor: "#696969",
|
||||||
color: "white",
|
color: "#262626",
|
||||||
border: "solid 1px white",
|
|
||||||
margin: "16px 16px 16px 0px",
|
margin: "16px 16px 16px 0px",
|
||||||
padding: "8px 12px 8px 12px",
|
padding: "8px 12px 8px 12px",
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
color: "white",
|
backgroundColor: "#808080",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
@@ -19,5 +18,5 @@ const StyledButton = withStyles({
|
|||||||
})(Button);
|
})(Button);
|
||||||
|
|
||||||
export default function ButtonPrimary(props) {
|
export default function ButtonPrimary(props) {
|
||||||
return <StyledButton>{props.text}</StyledButton>;
|
return <StyledButton onClick={props.onClick}>{props.text}</StyledButton>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user