Skip to content

Commit a748c93

Browse files
authored
UN-3003: Addition to navbar (#1659)
UN-3003: Staff access link
1 parent 3c37210 commit a748c93

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
FileProtectOutlined,
1717
LikeOutlined,
1818
LoginOutlined,
19+
SettingOutlined,
1920
} from "@ant-design/icons";
2021
import { useEffect, useState, useMemo, useCallback } from "react";
2122
import { useNavigate, useLocation } from "react-router-dom";
@@ -162,6 +163,8 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {
162163

163164
const isUnstract = !(selectedProduct && selectedProduct !== "unstract");
164165
const isAPIHub = selectedProduct && selectedProduct === "verticals";
166+
const isStaff = sessionDetails?.isStaff || sessionDetails?.is_staff;
167+
const isOpenSource = orgName === "mock_org";
165168

166169
// Check user role and whether the onboarding is incomplete
167170
useEffect(() => {
@@ -349,6 +352,22 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {
349352
});
350353
}
351354

355+
// Custom Plans
356+
if (isUnstract && isStaff && !isOpenSource) {
357+
menuItems.push({
358+
key: "8",
359+
label: (
360+
<Button
361+
onClick={() => navigate(`/${orgName}/admin/custom-plans`)}
362+
className="logout-button"
363+
type="text"
364+
>
365+
<SettingOutlined /> Custom Plans
366+
</Button>
367+
),
368+
});
369+
}
370+
352371
const handleLogin = () => {
353372
const baseUrl = getBaseUrl();
354373
const newURL = baseUrl + "/api/v1/login";

0 commit comments

Comments
 (0)