fixes / register user

This commit is contained in:
2021-02-08 15:48:21 +01:00
parent f25196f57e
commit ab0f65e247
10 changed files with 310 additions and 72 deletions

View File

@@ -39,7 +39,9 @@ const useStyles = makeStyles((theme) => ({
export default function TopBar() {
const classes = useStyles();
const loggedIn = useSelector((state) => state.data.loggedIn);
const username = useSelector((state) => state.data.userData.firstname);
const firstname = useSelector((state) => state.data.userData.firstname);
const login = useSelector((state) => state.data.userData.login);
const isRestaurant = useSelector((state) => state.data.userData.isRestaurant)
const history = useHistory();
const dispatch = useDispatch();
const handleClick = (button) => {
@@ -95,13 +97,13 @@ export default function TopBar() {
onClick={() => history.push("/")}
/>
<div className="vertical-divider"></div>
<h5>Food guide (wersja testowa)</h5>
<h5>Food guide</h5>
</div>
<div className="topBar-hamburger">
{loggedIn && (
<div className="topbar-username">
{" "}
<p>Witaj {username}</p>{" "}
<p>Witaj {isRestaurant ? firstname : login}</p>{" "}
</div>
)}
<IconButton onClick={toggleDrawer(true)} aria-label="menu">