From 4649202a74082588094c08b97d09fe6447688dc8 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 23 Apr 2021 22:18:28 +0200 Subject: hide profile section from footer when not logged in --- components/footer.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/footer.tsx b/components/footer.tsx index f39946c..af79154 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -1,5 +1,6 @@ import { ReactNode } from 'react'; import Logo from '../components/logo'; +import * as cookie from 'react-cookies'; import ExitToAppOutlinedIcon from '@material-ui/icons/ExitToAppOutlined'; import ExtensionIcon from '@material-ui/icons/Extension'; @@ -23,6 +24,8 @@ function PageLink(props: { } export function Footer() { + var loggedIn = !!cookie.load("token"); + return
@@ -39,11 +42,11 @@ export function Footer() { } href='/privacy' children='Privacy' /> } href='https://github.com/lonkaars/connect-4' children='Broncode' />
-
+ { loggedIn &&
} href='/settings' children='Instellingen' /> } href='/user' children='Profiel' /> } href='/logout' children='Uitloggen' /> -
+
}
; } -- cgit v1.2.3