diff --git a/apps/OpenSign/src/components/sidebar/Sidebar.js b/apps/OpenSign/src/components/sidebar/Sidebar.js index 23fb34fb6..069248b5f 100644 --- a/apps/OpenSign/src/components/sidebar/Sidebar.js +++ b/apps/OpenSign/src/components/sidebar/Sidebar.js @@ -4,11 +4,14 @@ import Submenu from "./SubMenu"; import SocialMedia from "./SocialMedia"; import dp from "../../assets/images/dp.png"; import sidebarList from "../../json/menuJson"; +import { useNavigate } from "react-router-dom"; +import { isStaging } from "../../constant/const"; const Sidebar = ({ isOpen, closeSidebar }) => { + const navigate = useNavigate(); const [menuList, setmenuList] = useState([]); const [submenuOpen, setSubmenuOpen] = useState(false); - let username = localStorage.getItem("username"); + const username = localStorage.getItem("username"); const image = localStorage.getItem("profileImg") || dp; const tenantname = localStorage.getItem("Extand_Class") ? JSON.parse(localStorage.getItem("Extand_Class"))?.[0]?.Company @@ -34,16 +37,8 @@ const Sidebar = ({ isOpen, closeSidebar }) => { userRole === "contracts_Admin" || userRole === "contracts_OrgAdmin" ) { - // const addUserForm = { - // icon: "fa-light fa-user", - // title: "Add User", - // target: "_self", - // pageType: "form", - // description: "", - // objectId: "lM0xRnM3iE" - // }; const newSidebarList = sidebarList.map((item) => { - if (item.title === "Settings") { + if (item.title === "Settings" && isStaging) { // Make a shallow copy of the item const newItem = { ...item }; newItem.children = [ @@ -65,8 +60,6 @@ const Sidebar = ({ isOpen, closeSidebar }) => { objectId: "users" } ]; - // Insert addUserForm at the second position - // newItem.children.splice(1, 0, addUserForm); return newItem; } return item; @@ -89,13 +82,19 @@ const Sidebar = ({ isOpen, closeSidebar }) => { closeSidebar(); setSubmenuOpen({}); }; + const handleProfile = () => { + navigate("/profile"); + }; return (