Fixed #7
This commit is contained in:
parent
df436e9832
commit
8d750fd31c
2 changed files with 37 additions and 26 deletions
|
@ -8,6 +8,7 @@ import IconButton from '@material-ui/core/IconButton';
|
|||
import MenuIcon from '@material-ui/icons/Menu';
|
||||
import Link from 'next/link'
|
||||
import AuthButton from './AuthButton'
|
||||
import { useSession } from 'next-auth/client'
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
|
@ -22,6 +23,7 @@ const useStyles = makeStyles((theme) => ({
|
|||
}));
|
||||
|
||||
export default function ButtonAppBar() {
|
||||
const [session, loading] = useSession()
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
|
@ -38,9 +40,9 @@ export default function ButtonAppBar() {
|
|||
Cath.exe
|
||||
</Link>
|
||||
</Typography>
|
||||
<Button color="inherit">Stats</Button>
|
||||
{session && <Button color="inherit">Stats</Button>}
|
||||
<AuthButton/>
|
||||
<Link href='/controlpanel'><Button color="inherit">Control Panel</Button></Link>
|
||||
{session && <Link href='/controlpanel'><Button color="inherit">Control Panel</Button></Link>}
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
</div>
|
||||
|
|
|
@ -8,6 +8,7 @@ import TableHead from '@material-ui/core/TableHead';
|
|||
import TableRow from '@material-ui/core/TableRow';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import Head from 'next/head'
|
||||
import { useSession } from 'next-auth/client'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
table: {
|
||||
|
@ -27,9 +28,12 @@ const rows = [
|
|||
];
|
||||
|
||||
function Commands() {
|
||||
const [session, loading] = useSession()
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<>
|
||||
{session &&
|
||||
<>
|
||||
<Head>
|
||||
<title>Cath Commands</title>
|
||||
|
@ -57,6 +61,11 @@ function Commands() {
|
|||
</Table>
|
||||
</TableContainer>
|
||||
</>
|
||||
} {!session && <>
|
||||
<h1>Seems like you're not logged in. Log in to get started!</h1>
|
||||
</>
|
||||
}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue