From 7bb9bfe55be8dd7198a4bfccf6281594a1661793 Mon Sep 17 00:00:00 2001 From: Sreehari Sujith <65402547+sreehhari@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:10:06 +0530 Subject: [PATCH] organization settings (#468) * pnpm-lock version update * organization settings only renders for ADMINs --- apps/web-admin/src/components/Sidebar.jsx | 48 ++++++++++++++--------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/apps/web-admin/src/components/Sidebar.jsx b/apps/web-admin/src/components/Sidebar.jsx index 48272038..4cf384a5 100644 --- a/apps/web-admin/src/components/Sidebar.jsx +++ b/apps/web-admin/src/components/Sidebar.jsx @@ -1,4 +1,4 @@ -import { useState, useContext } from 'react'; +import { useState, useContext, useEffect } from 'react'; import { useAuth0 } from '@auth0/auth0-react'; import { Box, @@ -26,6 +26,9 @@ const Sidebar = ({ isOpen, onClose }) => { const [loading, setLoading] = useState(false); const { logout } = useAuth0(); const [isMobile] = useMediaQuery('(max-width: 768px)'); + const { accountDetails } = useContext(account); + const isAdmin = accountDetails.role === 'ADMIN'; + // const isUser = accountDetails.role === 'USER'; const router = useRouter(); const { orgId } = router.query; @@ -61,15 +64,18 @@ const Sidebar = ({ isOpen, onClose }) => { - + {isAdmin && ( + + )} + + {isAdmin && ( + + )} +