From bbf290fee1da068628da939f872ae61cdfc624ae Mon Sep 17 00:00:00 2001 From: Moaz Dawalibi Date: Mon, 16 Sep 2024 12:33:53 +0300 Subject: [PATCH] fixes --- .../Layout/Navbar/NavBarRightSide.tsx | 5 ++-- src/Components/Layout/Navbar/Tooltip.tsx | 5 +++- src/Routes.tsx | 30 +++++++++---------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/Components/Layout/Navbar/NavBarRightSide.tsx b/src/Components/Layout/Navbar/NavBarRightSide.tsx index ff8bbc6..3d54e86 100644 --- a/src/Components/Layout/Navbar/NavBarRightSide.tsx +++ b/src/Components/Layout/Navbar/NavBarRightSide.tsx @@ -23,9 +23,7 @@ const NavBarRightSide = () => { // const translateArray = translateOptions(search_array, t); const { handel_open_model } = useModalHandler(); - const handleEdit = () => { - handel_open_model(ModalEnum.CHANGE_PASSWORD); - }; + return (
@@ -40,6 +38,7 @@ const NavBarRightSide = () => { icon={} /> (Navigate('/notifications'))} className="NotificationsIcon" note="notification" color="#E0E0E0" diff --git a/src/Components/Layout/Navbar/Tooltip.tsx b/src/Components/Layout/Navbar/Tooltip.tsx index 0f3969b..ba060fb 100644 --- a/src/Components/Layout/Navbar/Tooltip.tsx +++ b/src/Components/Layout/Navbar/Tooltip.tsx @@ -10,11 +10,13 @@ const TooltipComp = ({ color, icon, className = "", + onClick, }: { note: string; color: string; icon: any; className?: string; + onClick?:() => void }) => { const [t] = useTranslation(); const { handel_open_model } = useModalHandler(); @@ -23,11 +25,12 @@ const TooltipComp = ({ handel_open_model(ModalEnum.CHANGE_PASSWORD); }; return ( -
+
{t(`header.${note}`)}
} color={color} + >
{icon}
diff --git a/src/Routes.tsx b/src/Routes.tsx index 04c364a..20011e4 100644 --- a/src/Routes.tsx +++ b/src/Routes.tsx @@ -1,5 +1,7 @@ import { TCrudRoute, TMenuItem } from "./types/App"; -import { FaCashRegister, FaHome, FaMoneyBill, FaPaperclip, FaSellcast, FaTag, FaUser } from "react-icons/fa"; +import { FaCashRegister, FaHome, FaMoneyBill, FaPaperclip, FaSellcast, FaTag, FaUser,FaUserShield } from "react-icons/fa"; +import { CiSquareQuestion } from "react-icons/ci"; +import { GrGroup } from "react-icons/gr"; import React from "react"; const Dummy = React.lazy(() => import("./Pages/Home/Dummy")); @@ -96,7 +98,7 @@ export const menuItems: TMenuItem[] = [ { header: "page_header.student", element: , - icon: , + icon: , text: "sidebar.student", path: `/${ABILITIES_ENUM?.STUDENT}`, abilities: ABILITIES_ENUM?.STUDENT, @@ -137,27 +139,17 @@ export const menuItems: TMenuItem[] = [ { header: "page_header.questionBank", element: , - icon: , + icon: , text: "sidebar.questionBank", path: `/${ABILITIES_ENUM?.QUESTION}`, abilities: ABILITIES_ENUM?.QUESTION, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, }, - { - header: "page_header.notifications", - element: , - icon: , - text: "sidebar.notifications", - path: `/${ABILITIES_ENUM?.NOTIFICATIONS}`, - abilities: ABILITIES_ENUM?.NOTIFICATIONS, - abilities_value: ABILITIES_VALUES_ENUM.INDEX, - prevPath: 0, - }, { header: "page_header.roles", element: , - icon: , + icon: , text: "sidebar.role", path: `/${ABILITIES_ENUM?.ROLE}`, abilities: ABILITIES_ENUM?.ROLE, @@ -273,7 +265,15 @@ export const CrudRoute: TCrudRoute[] = [ abilities: ABILITIES_ENUM?.PROFILE, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, - } + }, + { + header: "page_header.notifications", + element: , + path: `/${ABILITIES_ENUM?.NOTIFICATIONS}`, + abilities: ABILITIES_ENUM?.NOTIFICATIONS, + abilities_value: ABILITIES_VALUES_ENUM.INDEX, + prevPath: 0, + }, ]; export const AppRoutes: Record = Object.fromEntries(