mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 11:20:17 -04:00
Add Logout component
This commit is contained in:
parent
b6ccd4a6b3
commit
a494c728eb
7
src/components/Logout.tsx
Normal file
7
src/components/Logout.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { Redirect } from 'react-router';
|
||||
|
||||
export default function Logout() {
|
||||
localStorage.removeItem('session_token');
|
||||
|
||||
return <Redirect to="/"></Redirect>;
|
||||
}
|
|
@ -22,8 +22,8 @@ const useStyles = makeStyles({
|
|||
});
|
||||
const navLinks = [
|
||||
{ title: `Profile`, path: `/profile` },
|
||||
{ title: `Groups`, path: `/groups` },
|
||||
{ title: `MyGroups`, path: `/mygroups` },
|
||||
// { title: `Groups`, path: `/groups` },
|
||||
// { title: `MyGroups`, path: `/mygroups` },
|
||||
];
|
||||
const Nav = () => {
|
||||
const classes = useStyles();
|
||||
|
|
|
@ -5,7 +5,6 @@ import Card from '@material-ui/core/Card';
|
|||
import Textarea from '@material-ui/core/TextareaAutosize';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import Comment from './Comment';
|
||||
import getSessionId from '../lib/getSessionId';
|
||||
import { makeAPIPostCall } from '../api/utils';
|
||||
|
||||
export default function Pool({ registered = false }: { registered?: boolean }) {
|
||||
|
|
|
@ -106,7 +106,10 @@ const Profile = () => {
|
|||
<div className="">
|
||||
{pools.map((pool) => {
|
||||
return (
|
||||
<Card className={classes.root + 'd-inline-flex'}>
|
||||
<Card
|
||||
className={classes.root + 'd-inline-flex'}
|
||||
style={{ margin: '0.5rem' }}
|
||||
>
|
||||
<CardActionArea href={'/pool/' + pool.id}>
|
||||
<CardContent>
|
||||
<Typography gutterBottom variant="h5" component="h2">
|
||||
|
|
Loading…
Reference in New Issue
Block a user