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 translateArray = translateOptions(search_array, t);
const { handel_open_model } = useModalHandler(); const { handel_open_model } = useModalHandler();
const handleEdit = () => {
handel_open_model(ModalEnum.CHANGE_PASSWORD);
};
return ( return (
<article> <article>
<span className="header_icons"> <span className="header_icons">
@ -40,6 +38,7 @@ const NavBarRightSide = () => {
icon={<CiCirclePlus size={25} />} icon={<CiCirclePlus size={25} />}
/> />
<TooltipComp <TooltipComp
onClick={()=>(Navigate('/notifications'))}
className="NotificationsIcon" className="NotificationsIcon"
note="notification" note="notification"
color="#E0E0E0" color="#E0E0E0"

View File

@ -10,11 +10,13 @@ const TooltipComp = ({
color, color,
icon, icon,
className = "", className = "",
onClick,
}: { }: {
note: string; note: string;
color: string; color: string;
icon: any; icon: any;
className?: string; className?: string;
onClick?:() => void
}) => { }) => {
const [t] = useTranslation(); const [t] = useTranslation();
const { handel_open_model } = useModalHandler(); const { handel_open_model } = useModalHandler();
@ -23,11 +25,12 @@ const TooltipComp = ({
handel_open_model(ModalEnum.CHANGE_PASSWORD); handel_open_model(ModalEnum.CHANGE_PASSWORD);
}; };
return ( return (
<div className={className}> <div className={className} onClick={onClick}>
<Tooltip <Tooltip
placement="top" placement="top"
title={<div onClick={handleEdit}>{t(`header.${note}`)}</div>} title={<div onClick={handleEdit}>{t(`header.${note}`)}</div>}
color={color} color={color}
> >
<div className={`gear `}>{icon}</div> <div className={`gear `}>{icon}</div>
</Tooltip> </Tooltip>

View File

@ -1,5 +1,7 @@
import { TCrudRoute, TMenuItem } from "./types/App"; 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"; import React from "react";
const Dummy = React.lazy(() => import("./Pages/Home/Dummy")); const Dummy = React.lazy(() => import("./Pages/Home/Dummy"));
@ -96,7 +98,7 @@ export const menuItems: TMenuItem[] = [
{ {
header: "page_header.student", header: "page_header.student",
element: <Student />, element: <Student />,
icon: <MdGrade />, icon: <GrGroup />,
text: "sidebar.student", text: "sidebar.student",
path: `/${ABILITIES_ENUM?.STUDENT}`, path: `/${ABILITIES_ENUM?.STUDENT}`,
abilities: ABILITIES_ENUM?.STUDENT, abilities: ABILITIES_ENUM?.STUDENT,
@ -137,27 +139,17 @@ export const menuItems: TMenuItem[] = [
{ {
header: "page_header.questionBank", header: "page_header.questionBank",
element: <QuestionBank />, element: <QuestionBank />,
icon: <FaSellcast />, icon: <CiSquareQuestion />,
text: "sidebar.questionBank", text: "sidebar.questionBank",
path: `/${ABILITIES_ENUM?.QUESTION}`, path: `/${ABILITIES_ENUM?.QUESTION}`,
abilities: ABILITIES_ENUM?.QUESTION, abilities: ABILITIES_ENUM?.QUESTION,
abilities_value: ABILITIES_VALUES_ENUM.INDEX, abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0, 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", header: "page_header.roles",
element: <Roles />, element: <Roles />,
icon: <FaSellcast />, icon: <FaUserShield />,
text: "sidebar.role", text: "sidebar.role",
path: `/${ABILITIES_ENUM?.ROLE}`, path: `/${ABILITIES_ENUM?.ROLE}`,
abilities: ABILITIES_ENUM?.ROLE, abilities: ABILITIES_ENUM?.ROLE,
@ -273,7 +265,15 @@ export const CrudRoute: TCrudRoute[] = [
abilities: ABILITIES_ENUM?.PROFILE, abilities: ABILITIES_ENUM?.PROFILE,
abilities_value: ABILITIES_VALUES_ENUM.INDEX, abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0, 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( export const AppRoutes: Record<string, string> = Object.fromEntries(