Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
FileProtectOutlined,
LikeOutlined,
LoginOutlined,
SettingOutlined,
} from "@ant-design/icons";
import { useEffect, useState, useMemo, useCallback } from "react";
import { useNavigate, useLocation } from "react-router-dom";
Expand Down Expand Up @@ -162,6 +163,8 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {

const isUnstract = !(selectedProduct && selectedProduct !== "unstract");
const isAPIHub = selectedProduct && selectedProduct === "verticals";
const isStaff = sessionDetails?.isStaff || sessionDetails?.is_staff;
const isOpenSource = orgName === "mock_org";

// Check user role and whether the onboarding is incomplete
useEffect(() => {
Expand Down Expand Up @@ -349,6 +352,22 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {
});
}

// Custom Plans
if (isUnstract && isStaff && !isOpenSource) {
menuItems.push({
key: "8",
label: (
<Button
onClick={() => navigate(`/${orgName}/admin/custom-plans`)}
className="logout-button"
type="text"
>
<SettingOutlined /> Custom Plans
</Button>
),
});
}

const handleLogin = () => {
const baseUrl = getBaseUrl();
const newURL = baseUrl + "/api/v1/login";
Expand Down