From 90ad62d41fe366d7ab5368ee0472cb0243b05fbf Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Sun, 28 May 2023 16:57:03 +0100 Subject: [PATCH] Navigation improvements --- src/components/Navbar/index.tsx | 12 ++++++------ src/components/Sidebar/index.tsx | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 935372d..a1ea3d6 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -72,11 +72,11 @@ const Navbar = () => { Templates @@ -109,22 +109,22 @@ const Navbar = () => { Projects Templates diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index db07a7a..a55bf2f 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -96,7 +96,7 @@ const Sidebar = () => { }); useEffect(() => { - if (/project/i.test(location.pathname)) { + if (/(project|support)/i.test(location.pathname)) { if (role !== 'client') getProjects(); else getProjectsByClientId({ variables: { id: currentUser?.id! } }); } @@ -123,7 +123,7 @@ const Sidebar = () => { const showAddButton = (role: string, pathname: string) => { switch (role) { case 'client': - return /project/i.test(pathname); + return /(project|support)/i.test(pathname); case 'productOwner': return /template/i.test(pathname); case 'developer': @@ -139,7 +139,7 @@ const Sidebar = () => { <> {projects && - new RegExp(/project/, 'i').test(location.pathname) && + new RegExp(/(project|support)/, 'i').test(location.pathname) && projects.map((project, index) => (
@@ -261,7 +261,7 @@ const Sidebar = () => { /> )} - {/project/i.test(location.pathname) && + {/(project|support)/i.test(location.pathname) && ['client', 'productOwner'].includes(role as string) && (