This commit is contained in:
Moaz Dawalibi 2024-09-16 12:33:53 +03:00
parent a987ec7dad
commit bbf290fee1
3 changed files with 21 additions and 19 deletions

View File

@ -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 (
<article>
<span className="header_icons">
@ -40,6 +38,7 @@ const NavBarRightSide = () => {
icon={<CiCirclePlus size={25} />}
/>
<TooltipComp
onClick={()=>(Navigate('/notifications'))}
className="NotificationsIcon"
note="notification"
color="#E0E0E0"

View File

@ -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 (
<div className={className}>
<div className={className} onClick={onClick}>
<Tooltip
placement="top"
title={<div onClick={handleEdit}>{t(`header.${note}`)}</div>}
color={color}
>
<div className={`gear `}>{icon}</div>
</Tooltip>

View File

@ -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: <Student />,
icon: <MdGrade />,
icon: <GrGroup />,
text: "sidebar.student",
path: `/${ABILITIES_ENUM?.STUDENT}`,
abilities: ABILITIES_ENUM?.STUDENT,
@ -137,27 +139,17 @@ export const menuItems: TMenuItem[] = [
{
header: "page_header.questionBank",
element: <QuestionBank />,
icon: <FaSellcast />,
icon: <CiSquareQuestion />,
text: "sidebar.questionBank",
path: `/${ABILITIES_ENUM?.QUESTION}`,
abilities: ABILITIES_ENUM?.QUESTION,
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0,
},
{
header: "page_header.notifications",
element: <Notifications />,
icon: <FaSellcast />,
text: "sidebar.notifications",
path: `/${ABILITIES_ENUM?.NOTIFICATIONS}`,
abilities: ABILITIES_ENUM?.NOTIFICATIONS,
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0,
},
{
header: "page_header.roles",
element: <Roles />,
icon: <FaSellcast />,
icon: <FaUserShield />,
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: <Notifications />,
path: `/${ABILITIES_ENUM?.NOTIFICATIONS}`,
abilities: ABILITIES_ENUM?.NOTIFICATIONS,
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0,
},
];
export const AppRoutes: Record<string, string> = Object.fromEntries(