AsuraBar React.state fix

This commit is contained in:
Kristoffer Juelsenn 2022-04-06 14:23:20 +02:00
parent 25ffeeeff3
commit f8b376768d
1 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import HistoryIcon from '@mui/icons-material/History';
import LogoutIcon from '@mui/icons-material/Logout'; import LogoutIcon from '@mui/icons-material/Logout';
import logo from "./../Asura2222.png"; import logo from "./../Asura2222.png";
function loggedInMenu() { function LoggedInMenu() {
const [anchorEl, setAnchorEl] = React.useState(null); const [anchorEl, setAnchorEl] = React.useState(null);
const open = Boolean(anchorEl); const open = Boolean(anchorEl);
const handleClick = (event) => { const handleClick = (event) => {
@ -30,6 +30,7 @@ function loggedInMenu() {
); );
} }
function notLoggedInButton() { function notLoggedInButton() {
return ( return (
<> <>
@ -43,7 +44,7 @@ function notLoggedInButton() {
} }
export default function Appbar(props) { export default function Appbar(props) {
const isLoggedIn = true; const isLoggedIn = false;
return ( return (
<> <>
@ -70,7 +71,7 @@ export default function Appbar(props) {
<Typography component="div"><h2>{props.pageTitle || ""}</h2></Typography> <Typography component="div"><h2>{props.pageTitle || ""}</h2></Typography>
</Grid> </Grid>
<Grid item xs={2}> <Grid item xs={2}>
{ isLoggedIn ? <loggedInMenu /> : <notLoggedInButton /> } { isLoggedIn ? <LoggedInMenu /> : <notLoggedInButton /> }
</Grid> </Grid>
</Grid> </Grid>
</Box> </Box>