web client v0.2 (add restaurant OK, settings OK)
This commit is contained in:
@@ -13,12 +13,13 @@ import ListItemText from "@material-ui/core/ListItemText";
|
||||
import ListItemIcon from "@material-ui/core/ListItemIcon";
|
||||
import HomeIcon from "@material-ui/icons/Home";
|
||||
import MailIcon from "@material-ui/icons/Mail";
|
||||
import PaymentIcon from "@material-ui/icons/Payment";
|
||||
import { logout } from "../actions";
|
||||
import { showRegulamin } from "../actions/toggles.js";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import ButtonSecondary from "./Input/ButtonSecondary";
|
||||
import ListSubheader from "@material-ui/core/ListSubheader";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import GavelIcon from "@material-ui/icons/Gavel";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
paper: {
|
||||
@@ -38,7 +39,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
export default function TopBar() {
|
||||
const classes = useStyles();
|
||||
const loggedIn = useSelector((state) => state.data.loggedIn);
|
||||
const username = useSelector((state) => state.data.username);
|
||||
const username = useSelector((state) => state.data.userData.firstname);
|
||||
const history = useHistory();
|
||||
const dispatch = useDispatch();
|
||||
const handleClick = (button) => {
|
||||
@@ -50,18 +51,18 @@ export default function TopBar() {
|
||||
case "logIn":
|
||||
history.push("/login");
|
||||
break;
|
||||
case "kontakt":
|
||||
history.push("/kontakt");
|
||||
break;
|
||||
case "regulamin":
|
||||
dispatch(showRegulamin());
|
||||
break;
|
||||
case "register":
|
||||
history.push("/register");
|
||||
break;
|
||||
case "logOut":
|
||||
dispatch(logout());
|
||||
break;
|
||||
case "myRestaurant":
|
||||
history.push("/restaurant");
|
||||
break;
|
||||
case "addDish":
|
||||
history.push("/");
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
@@ -128,17 +129,17 @@ export default function TopBar() {
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Menui" />
|
||||
</ListItem>
|
||||
<ListItem button onClick={() => handleClick("contact")}>
|
||||
<ListItem button onClick={() => handleClick("kontakt")}>
|
||||
<ListItemIcon>
|
||||
<MailIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Kontakt" />
|
||||
</ListItem>
|
||||
<ListItem button onClick={() => handleClick("pricing")}>
|
||||
<ListItem button onClick={() => handleClick("regulamin")}>
|
||||
<ListItemIcon>
|
||||
<PaymentIcon />
|
||||
<GavelIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Cennik" />
|
||||
<ListItemText primary="Regulamin" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
|
||||
Reference in New Issue
Block a user