From 8eb79a979620273dd90c0dc5ec7d8c3b3c4dea92 Mon Sep 17 00:00:00 2001 From: nickviola Date: Tue, 19 Mar 2024 07:57:54 -0500 Subject: [PATCH] Modify Header.tsx to include conditional Nav menu items for regionalAdmin user type --- frontend/src/components/Header.tsx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index e6b751dd..54420ead 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -247,16 +247,16 @@ const HeaderNoCtx: React.FC = (props) => { exact: false }, - /* + /* Hiding Feeds page until finished - { title: 'Feeds', - path: '/feeds', - users: ALL_USERS, - exact: false + { title: 'Feeds', + path: '/feeds', + users: ALL_USERS, + exact: false },*/ - /* - Hiding Reports page until finished + /* + Hiding Reports page until finished { title: 'Reports', path: '/reports', @@ -361,7 +361,22 @@ const HeaderNoCtx: React.FC = (props) => { )); + const userRegistrationNavItem = { + title: 'User Registration', + path: '/region-admin-dasboard', + users: ALL_USERS, + exact: true + }; + + const getConditionalNavItems = () => { + if (user?.userType === 'regionalAdmin') { + userMenu.nested?.push(userRegistrationNavItem); + userItemsSmall.push(userRegistrationNavItem); + } + }; + const navItemsToUse = () => { + getConditionalNavItems(); if (isSmall) { return userItemsSmall; } else {