2021-06-21 16:12:57 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { makeStyles } from '@material-ui/core/styles';
|
|
|
|
import AppBar from '@material-ui/core/AppBar';
|
|
|
|
import Toolbar from '@material-ui/core/Toolbar';
|
|
|
|
import Typography from '@material-ui/core/Typography';
|
|
|
|
import Button from '@material-ui/core/Button';
|
|
|
|
import IconButton from '@material-ui/core/IconButton';
|
|
|
|
import MenuIcon from '@material-ui/icons/Menu';
|
|
|
|
import Link from 'next/link'
|
|
|
|
import AuthButton from './AuthButton'
|
2021-06-22 02:19:52 +02:00
|
|
|
import { useSession } from 'next-auth/client'
|
2021-06-21 16:12:57 +02:00
|
|
|
|
|
|
|
const useStyles = makeStyles((theme) => ({
|
|
|
|
root: {
|
|
|
|
flexGrow: 1,
|
|
|
|
},
|
|
|
|
menuButton: {
|
|
|
|
marginRight: theme.spacing(2),
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
flexGrow: 1,
|
|
|
|
},
|
|
|
|
}));
|
|
|
|
|
|
|
|
export default function ButtonAppBar() {
|
2021-06-22 02:19:52 +02:00
|
|
|
const [session, loading] = useSession()
|
2021-06-21 16:12:57 +02:00
|
|
|
const classes = useStyles();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classes.root}>
|
|
|
|
<AppBar position="static" color='primary' style={{
|
|
|
|
background: '#1F1B24'
|
|
|
|
}}>
|
|
|
|
<Toolbar>
|
|
|
|
<IconButton edge="start" className={classes.menuButton} color="inherit" aria-label="menu">
|
|
|
|
<MenuIcon />
|
|
|
|
</IconButton>
|
|
|
|
<Typography variant="h6" className={classes.title}>
|
|
|
|
<Link href='/'>
|
|
|
|
Cath.exe
|
|
|
|
</Link>
|
|
|
|
</Typography>
|
2021-06-22 02:19:52 +02:00
|
|
|
{session && <Button color="inherit">Stats</Button>}
|
2021-06-21 16:12:57 +02:00
|
|
|
<AuthButton/>
|
2021-06-22 02:19:52 +02:00
|
|
|
{session && <Link href='/controlpanel'><Button color="inherit">Control Panel</Button></Link>}
|
2021-06-21 16:12:57 +02:00
|
|
|
</Toolbar>
|
|
|
|
</AppBar>
|
|
|
|
</div>
|
|
|
|
);
|
2021-06-20 13:39:00 +02:00
|
|
|
}
|