Skip to content

Commit

Permalink
Merge pull request #99 from cisagov/issue-22/add-region-dashboard-men…
Browse files Browse the repository at this point in the history
…u-item

Modify Header.tsx to include conditional nav items for regionalAdmin User Type
  • Loading branch information
schmelz21 authored Mar 20, 2024
2 parents 8fe2660 + 91e2e45 commit 8c9c955
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,22 @@ const HeaderNoCtx: React.FC<ContextType> = (props) => {
<NavItem key={item.title.toString()} {...item} />
));

const userRegistrationNavItem = {
title: 'User Registration',
path: '/region-admin-dasboard',
users: ALL_USERS,
exact: true
};

const getConditionalNavItems = () => {
if (user?.userType === 'regionalAdmin') {
userMenu.nested?.unshift(userRegistrationNavItem);
userItemsSmall.unshift(userRegistrationNavItem);
}
};

const navItemsToUse = () => {
getConditionalNavItems();
if (isSmall) {
return userItemsSmall;
} else {
Expand Down

0 comments on commit 8c9c955

Please sign in to comment.