From a494c728ebdcfa3c7abea7c5cb46d02a574b9abd Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Sat, 10 Apr 2021 18:49:18 -0400 Subject: [PATCH] Add Logout component --- src/components/Logout.tsx | 7 +++++++ src/components/Nav.tsx | 4 ++-- src/components/Pool.tsx | 1 - src/components/Profile.tsx | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 src/components/Logout.tsx diff --git a/src/components/Logout.tsx b/src/components/Logout.tsx new file mode 100644 index 0000000..28ad5a3 --- /dev/null +++ b/src/components/Logout.tsx @@ -0,0 +1,7 @@ +import { Redirect } from 'react-router'; + +export default function Logout() { + localStorage.removeItem('session_token'); + + return ; +} diff --git a/src/components/Nav.tsx b/src/components/Nav.tsx index 595a4e6..56bc356 100644 --- a/src/components/Nav.tsx +++ b/src/components/Nav.tsx @@ -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(); diff --git a/src/components/Pool.tsx b/src/components/Pool.tsx index 00ba16a..80896ce 100644 --- a/src/components/Pool.tsx +++ b/src/components/Pool.tsx @@ -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 }) { diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx index eebcd1f..973c036 100644 --- a/src/components/Profile.tsx +++ b/src/components/Profile.tsx @@ -106,7 +106,10 @@ const Profile = () => {
{pools.map((pool) => { return ( - +