Add Logout component

This commit is contained in:
Michael Fatemi 2021-04-10 18:49:18 -04:00
parent b6ccd4a6b3
commit a494c728eb
4 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,7 @@
import { Redirect } from 'react-router';
export default function Logout() {
localStorage.removeItem('session_token');
return <Redirect to="/"></Redirect>;
}

View File

@ -22,8 +22,8 @@ const useStyles = makeStyles({
}); });
const navLinks = [ const navLinks = [
{ title: `Profile`, path: `/profile` }, { title: `Profile`, path: `/profile` },
{ title: `Groups`, path: `/groups` }, // { title: `Groups`, path: `/groups` },
{ title: `MyGroups`, path: `/mygroups` }, // { title: `MyGroups`, path: `/mygroups` },
]; ];
const Nav = () => { const Nav = () => {
const classes = useStyles(); const classes = useStyles();

View File

@ -5,7 +5,6 @@ import Card from '@material-ui/core/Card';
import Textarea from '@material-ui/core/TextareaAutosize'; import Textarea from '@material-ui/core/TextareaAutosize';
import Typography from '@material-ui/core/Typography'; import Typography from '@material-ui/core/Typography';
import Comment from './Comment'; import Comment from './Comment';
import getSessionId from '../lib/getSessionId';
import { makeAPIPostCall } from '../api/utils'; import { makeAPIPostCall } from '../api/utils';
export default function Pool({ registered = false }: { registered?: boolean }) { export default function Pool({ registered = false }: { registered?: boolean }) {

View File

@ -106,7 +106,10 @@ const Profile = () => {
<div className=""> <div className="">
{pools.map((pool) => { {pools.map((pool) => {
return ( return (
<Card className={classes.root + 'd-inline-flex'}> <Card
className={classes.root + 'd-inline-flex'}
style={{ margin: '0.5rem' }}
>
<CardActionArea href={'/pool/' + pool.id}> <CardActionArea href={'/pool/' + pool.id}>
<CardContent> <CardContent>
<Typography gutterBottom variant="h5" component="h2"> <Typography gutterBottom variant="h5" component="h2">