From ef2f55457f54be6a13e0368f3164e6be70edcf42 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 11 Feb 2023 19:39:30 +0800 Subject: [PATCH] Take care of unauth-ed cases --- src/components/menu.jsx | 58 +++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/components/menu.jsx b/src/components/menu.jsx index 8ec5d3f7..6809be0a 100644 --- a/src/components/menu.jsx +++ b/src/components/menu.jsx @@ -7,7 +7,7 @@ import Icon from './icon'; import Link from './link'; function NavMenu(props) { - const { instance } = api(); + const { instance, authenticated } = api(); return ( Home - - Notifications - - - - Lists - - - Followed Hashtags - - - Bookmarks - - - Favourites - + {authenticated && ( + <> + + Notifications + + + + Lists + + + Followed Hashtags + + + Bookmarks + + + Favourites + + + )} Search @@ -52,14 +56,18 @@ function NavMenu(props) { Federated - - { - states.showSettings = true; - }} - > - Settings - + {authenticated && ( + <> + + { + states.showSettings = true; + }} + > + Settings + + + )} ); }