Compare commits

..

No commits in common. "893d564334447eedb60fcb61f7d0d9dfc70e46df" and "b873ac0bba800e8764b4195fb8127bbe3dc161ca" have entirely different histories.

46 changed files with 1012 additions and 416 deletions

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 861 B

After

Width:  |  Height:  |  Size: 861 B

View File

@ -1,15 +1,64 @@
import { Suspense, lazy } from "react"; import React, { Suspense, lazy, useEffect } from "react";
import { Route, Routes } from "react-router-dom"; import { Route, Routes, useNavigate } from "react-router-dom";
import Layout from "./Layout/Ui/Layout";
import { CrudRoute, menuItems } from "./Routes"; import { CrudRoute, menuItems } from "./Routes";
import { Spin } from "antd"; import { Spin } from "antd";
import { hasAbility } from "./utils/hasAbility"; import { hasAbility } from "./utils/hasAbility";
import { renderRoutesRecursively } from "./Components/Routes/RenderRoutesRecursively"; import { useChangeLanguage } from "./Hooks/useChangeLanguage";
import { RenderRouteElement } from "./Components/Routes/RenderRouteElement"; import useAuthState from "./zustand/AuthState";
import { TMenuItem } from "./types/App";
import { useTranslation } from "react-i18next";
import SpinContainer from "./Components/Layout/SpinContainer";
const Page404 = lazy(() => import("./Layout/Ui/NotFoundPage")); const Page404 = lazy(() => import("./Layout/Ui/NotFoundPage"));
const Auth = lazy(() => import("./Pages/Auth/Page")); const Auth = lazy(() => import("./Pages/Auth/Page"));
const App = () => { const App = () => {
const { changeLanguage } = useChangeLanguage();
const navigate = useNavigate();
const { isAuthenticated } = useAuthState();
const [t] = useTranslation();
useEffect(() => {
if (!isAuthenticated) {
navigate("/auth");
}
}, [isAuthenticated, navigate]);
const renderRouteElement = (route: any) => (
<Suspense
fallback={
<Layout>
{" "}
<SpinContainer />{" "}
</Layout>
}
>
{route.header ? (
<Layout>{route.element}</Layout>
) : (
route.element || <h1>please Create the Page</h1>
)}
</Suspense>
);
const renderRoutesRecursively = (routes: TMenuItem[]) =>
routes.map((route: TMenuItem) => {
const useAbility = hasAbility(route.abilities, route.abilities_value);
const tableHeader = t(`${route?.header}`);
// useSetPageTitle(tableHeader,route?.path);
if (useAbility) {
return (
<React.Fragment key={route.path}>
<Route path={route.path} element={renderRouteElement(route)} />
{route.children && renderRoutesRecursively(route.children)}
</React.Fragment>
);
}
return null;
});
return ( return (
<Routes> <Routes>
<Route <Route
@ -17,7 +66,8 @@ const App = () => {
path={"/auth"} path={"/auth"}
element={ element={
<Suspense fallback={<Spin />}> <Suspense fallback={<Spin />}>
<Auth /> {" "}
<Auth />{" "}
</Suspense> </Suspense>
} }
/> />
@ -26,7 +76,8 @@ const App = () => {
path={"/*"} path={"/*"}
element={ element={
<Suspense fallback={<Spin />}> <Suspense fallback={<Spin />}>
<Page404 /> {" "}
<Page404 />{" "}
</Suspense> </Suspense>
} }
/> />
@ -35,6 +86,9 @@ const App = () => {
{CrudRoute.map((route) => { {CrudRoute.map((route) => {
const useAbility = hasAbility(route.abilities, route.abilities_value); const useAbility = hasAbility(route.abilities, route.abilities_value);
const tableHeader = t(`${route?.header}`);
// useSetPageTitle(tableHeader,route?.path);
if (!useAbility) { if (!useAbility) {
return false; return false;
} }
@ -42,7 +96,7 @@ const App = () => {
<Route <Route
key={route.path ?? ""} key={route.path ?? ""}
path={route.path ?? ""} path={route.path ?? ""}
element={RenderRouteElement(route)} element={renderRouteElement(route)}
/> />
); );
})} })}

View File

@ -1,16 +0,0 @@
import { MdExpandLess, MdExpandMore } from "react-icons/md";
interface DropdownToggleProps {
isOpen: boolean;
onClick: () => void;
}
const DropdownToggle: React.FC<DropdownToggleProps> = ({ isOpen, onClick }) => {
return (
<div className="DropDownIcon" onClick={onClick}>
{isOpen ? <MdExpandLess /> : <MdExpandMore />}
</div>
);
};
export default DropdownToggle;

View File

@ -1,37 +0,0 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useNavigate } from "react-router-dom";
import DropdownToggle from "./DropdownToggle"; // Adjust the import path as necessary
import SubMenu from "./SubMenu"; // Adjust the import path as necessary
export const MenuItem = ({ item, location, index }: any) => {
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
const [openDropdown, setOpenDropdown] = useState<number | null>(null);
const [t] = useTranslation();
const navigate = useNavigate();
const handleDropdown = (index: number) => {
setOpenDropdown((prev) => (prev === index ? null : index));
};
const isDropdownOpen = openDropdown === index;
return (
<>
<div
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"}`}
onClick={() => navigate(item.path || "/")}
>
<i>{item.icon}</i>
<Link to={item.path || "/"}>{t(item.text)}</Link>
{item?.children && (
<DropdownToggle isOpen={isDropdownOpen} onClick={() => handleDropdown(index)} />
)}
</div>
{item?.children && isDropdownOpen && (
<SubMenu items={item.children} location={location} />
)}
</>
);
};

View File

@ -1,54 +0,0 @@
import React from 'react'
import { getLocalStorage } from '../../../utils/LocalStorage';
import { USER_KEY } from '../../../config/AppKey';
import { translateOptions } from '../../../utils/translatedOptions';
import { search_array } from '../../../Routes';
import { useTranslation } from 'react-i18next';
import SearchFieldWithSelect from '../../DataTable/SearchFieldWithSelect';
import { Tooltip } from 'antd';
import useModalHandler from '../../../utils/useModalHandler';
import { ModalEnum } from '../../../enums/Model';
import Image from '../../Ui/Image';
const NavBarRightSide = () => {
const userData = getLocalStorage(USER_KEY);
const [t] = useTranslation()
const translateArray = translateOptions(search_array, t);
const { handel_open_model } = useModalHandler();
const handleEdit = () => {
handel_open_model(ModalEnum.CHANGE_PASSWORD);
};
return (
<article>
<div className="header_search">
<SearchFieldWithSelect
options={translateArray}
placeholder={t("practical.search_here")}
/>
</div>
<span className="header_icons">
<div>
<Image src="/Icon/bell.png" alt="Notifications" />
</div>
<Tooltip
placement="top"
title={<div onClick={handleEdit}>{t("header.change_your_current_password")}</div>}
color="#E0E0E0"
>
<div className="gear">
<Image src="/Icon/gear.png" alt="Settings" />
</div>
</Tooltip>
</span>
<div className="header_profile">
<span>
<h6>{userData?.username}</h6>
<p>{userData?.type}</p>
</span>
<Image src="/Layout/DefaultStudentImage.png" alt="Profile" />
</div>
</article>
)
}
export default NavBarRightSide

View File

@ -1,19 +0,0 @@
import React from "react";
import { MenuItem } from "./MenuItem"; // Adjust the import path as necessary
interface SubMenuProps {
items: any[];
location: any;
}
const SubMenu: React.FC<SubMenuProps> = ({ items, location }) => {
return (
<div className="sub-menu">
{items.map((childItem, index) => (
<MenuItem key={index} item={childItem} location={location} index={index} />
))}
</div>
);
};
export default SubMenu;

View File

@ -1,63 +0,0 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { MdExpandLess, MdExpandMore } from "react-icons/md";
import { Link, useNavigate } from "react-router-dom";
export const MenuItem = ({ item, location, index }: any) => {
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
// console.log(location.pathname.split("/")[1]);
const [openDropdown, setOpenDropdown] = useState<number | null>(null);
const handleDropdown = (index: number) => {
setOpenDropdown((prev) => (prev === index ? null : index));
};
const isDropdownOpen = openDropdown === index;
const [t] = useTranslation();
const navigate = useNavigate();
return (
<>
<div
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"} `}
onClick={() => navigate(item.path || "/")}
>
<i>{item.icon}</i>
<Link to={item.path || "/"}>{t(item.text)}</Link>
{item?.children && (
<>
{isDropdownOpen ? (
<div
className="DropDownIcon"
onClick={() => handleDropdown(index)}
>
<MdExpandLess />
</div>
) : (
<div
className="DropDownIcon"
onClick={() => handleDropdown(index)}
>
<MdExpandMore />
</div>
)}
</>
)}
</div>
{item?.children && isDropdownOpen && (
<div className="sub-menu">
{item.children.map((childItem: any, index: any) => (
<MenuItem
key={index}
item={childItem}
location={location}
index={index}
/>
))}
</div>
)}
</>
);
};

View File

@ -15,7 +15,7 @@ const TabsBar = ({ steps }: any) => {
!step.hidden && ( !step.hidden && (
<div <div
onClick={() => handleTabClick(index)} onClick={() => handleTabClick(index)}
className={`ModelBodyTab ${ActiveTab === index ? "activeModelTab" : ""}`} className={`ModelBodyTab ${ActiveTab === index ? "activeModeltab" : ""}`}
key={index} key={index}
> >
<div>{index + 1}</div> <div>{index + 1}</div>

View File

@ -1,19 +0,0 @@
import { Suspense } from "react";
import SpinContainer from "../Layout/SpinContainer";
import Layout from "../../Layout/Ui/Layout";
export const RenderRouteElement = (route: any) => (
<Suspense
fallback={
<Layout>
<SpinContainer />
</Layout>
}
>
{route.header ? (
<Layout>{route.element}</Layout>
) : (
route.element || <></>
)}
</Suspense>
);

View File

@ -1,20 +0,0 @@
import React from "react";
import { TMenuItem } from "../../types/App";
import { hasAbility } from "../../utils/hasAbility";
import { Route } from "react-router-dom";
import { RenderRouteElement } from "./RenderRouteElement";
export const renderRoutesRecursively = (routes: TMenuItem[]) =>
routes.map((route: TMenuItem) => {
const useAbility = hasAbility(route.abilities, route.abilities_value);
if (!useAbility) {
return false;
}
return (
<React.Fragment key={route.path}>
<Route path={route.path} element={RenderRouteElement(route)} />
{route.children && renderRoutesRecursively(route.children)}
</React.Fragment>
);
});

View File

@ -0,0 +1,54 @@
import React, { memo } from "react";
import type { MenuProps } from "antd";
import { Button, Dropdown, Space } from "antd";
import { useChangeLanguage } from "../../Hooks/useChangeLanguage";
import { useTranslation } from "react-i18next";
const Translate: React.FC = () => {
const { currentLanguage, changeLanguage } = useChangeLanguage();
const { t } = useTranslation();
const EnLanguage = memo(() => (
<div className="MenuChange" onClick={EnLanguageClickHandler}>
<img alt="" src="../Layout/En.svg" width={20} height={20} />
{t("En")}
</div>
));
const ArLanguage = memo(() => (
<div className="MenuChange" onClick={ArLanguageClickHandler}>
<img alt="" src="../Layout/Ar.svg" width={20} height={20} />
{t("Ar")}
</div>
));
const EnLanguageClickHandler = React.useCallback(() => {
changeLanguage("en");
}, [changeLanguage]);
const ArLanguageClickHandler = React.useCallback(() => {
changeLanguage("ar");
}, [changeLanguage]);
const items: MenuProps["items"] = [
{
key: "1",
label: <EnLanguage />,
},
{
key: "2",
label: <ArLanguage />,
},
];
return (
<Space direction="vertical">
<Dropdown menu={{ items }} placement="top">
<Button disabled>
{currentLanguage === "en" ? <EnLanguage /> : <ArLanguage />}
</Button>
</Dropdown>
</Space>
);
};
export default Translate;

View File

@ -0,0 +1,47 @@
import { useCallback, useLayoutEffect, useState } from "react";
import translationEN from "../translate/en.json";
import translationAR from "../translate/ar.json";
import { initReactI18next } from "react-i18next";
import i18n from "i18next"; // Make sure this import is correct
import { LANGUAGE_KEY } from "../config/AppKey";
i18n.use(initReactI18next).init({
resources: {
en: {
translation: translationEN,
},
ar: {
translation: translationAR,
},
},
lng: localStorage.getItem(LANGUAGE_KEY) || "ar",
interpolation: {
escapeValue: false,
},
});
export const useChangeLanguage = () => {
const [currentLanguage, setCurrentLanguage] = useState(
localStorage.getItem(LANGUAGE_KEY) || "ar",
);
useLayoutEffect(() => {
if (currentLanguage === "ar") {
i18n.changeLanguage("ar");
document.body.setAttribute("dir", "rtl");
document.body.classList.remove("en");
} else if (currentLanguage === "en") {
i18n.changeLanguage("en");
document.body.setAttribute("dir", "ltr");
document.body.classList.add("en");
}
localStorage.setItem(LANGUAGE_KEY, currentLanguage);
}, [currentLanguage]);
const changeLanguage = useCallback((newLanguage: any) => {
setCurrentLanguage(newLanguage);
}, []);
return { currentLanguage, changeLanguage };
};

View File

@ -1,12 +1,12 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { usePageTitleState } from "../zustand/PageTitleState"; import { usePage_titleState } from "../zustand/PageTitleState";
const useSetPageTitle = (title: any) => { const useSetPageTitle = (title: any) => {
const setPageTitle = usePageTitleState((state) => state.setPageTitle); const setPage_title = usePage_titleState((state) => state.setPage_title);
useEffect(() => { useEffect(() => {
setPageTitle(title); setPage_title(title);
}, [title, setPageTitle]); }, [title, setPage_title]);
}; };
export default useSetPageTitle; export default useSetPageTitle;

View File

@ -1,7 +1,10 @@
import React from "react"; import React, { useEffect } from "react";
import { useGetTitleFromRoute } from "../../Hooks/useGetTitleFromRoute";
import { Helmet } from "react-helmet";
import { useLocation } from "react-router-dom";
import NavBar from "./NavBar"; import NavBar from "./NavBar";
import SideBar from "./SideBar"; import SideBar from "./SideBar";
import ProtectedRouteProvider from "../../lib/ProtectedRouteProvider"; import { USER_KEY } from "../../config/AppKey";
const Layout = ({ const Layout = ({
children, children,
@ -10,17 +13,21 @@ const Layout = ({
children: React.ReactNode; children: React.ReactNode;
className?: string; className?: string;
}) => { }) => {
const location = useLocation();
return ( return (
<>
<ProtectedRouteProvider className="Layout"> <Helmet>
<title>{useGetTitleFromRoute(location.pathname)}</title>
</Helmet>
<div className="Layout">
<main className={`${className} Layout_Body`}> <main className={`${className} Layout_Body`}>
<NavBar /> <NavBar />
<div className="Layout_Children">{children}</div> <div className="Layout_Children">{children}</div>
</main> </main>
<SideBar /> <SideBar />
</ProtectedRouteProvider> </div>
</>
); );
}; };

View File

@ -1,40 +1,86 @@
import React, { lazy, Suspense } from "react"; import React from "react";
import Image from "../../Components/Ui/Image";
import { usePageTitleState } from "../../zustand/PageTitleState"; import SearchField from "../../Components/DataTable/SearchFieldWithSelect";
import { usePage_titleState } from "../../zustand/PageTitleState";
import { MdOutlineArrowForwardIos } from "react-icons/md"; import { MdOutlineArrowForwardIos } from "react-icons/md";
import { useLocation, useNavigate } from "react-router-dom"; import { useLocation, useNavigate, useParams } from "react-router-dom";
import { search_array } from "../../Routes";
import { BRANCH_OBJECT_KEY, USER_KEY } from "../../config/AppKey";
import { useTranslation } from "react-i18next";
import { translateOptions } from "../../utils/translatedOptions";
import { ParamsEnum } from "../../enums/params";
import { Tooltip } from "antd";
import useModalHandler from "../../utils/useModalHandler";
import { ModalEnum } from "../../enums/Model";
import ChangePasswordModel from "./model/AddModel";
import { getLocalStorage } from "../../utils/LocalStorage";
import { getPrevPathRoute } from "../../utils/getPrevPathRoute"; import { getPrevPathRoute } from "../../utils/getPrevPathRoute";
import { deletePathSegments } from "../../utils/deletePathSegments"; import { deletePathSegments } from "../../utils/deletePathSegments";
import SpinContainer from "../../Components/Layout/SpinContainer";
import NavBarRightSide from "../../Components/Layout/Navbar/NavBarRightSide";
// Lazy load the ChangePasswordModel
const ChangePasswordModel = lazy(() => import("./model/AddModel"));
const NavBar = () => { const NavBar = () => {
const { PageTitle } = usePageTitleState((state) => state); const { Page_title } = usePage_titleState((state) => state);
const userData = getLocalStorage(USER_KEY);
const [t] = useTranslation();
const location = useLocation(); const location = useLocation();
const translateArray = translateOptions(search_array, t);
const navigate = useNavigate(); const navigate = useNavigate();
const PrevPath = getPrevPathRoute(location.pathname); const PrevPath = getPrevPathRoute(location.pathname);
const handelNavigate = () => { const handelNavigate = () => {
if (PrevPath === 0) { if (PrevPath === 0) {
return; return 0;
} }
navigate(deletePathSegments(location.pathname, PrevPath)); navigate(deletePathSegments(location.pathname, PrevPath));
}; };
const { handel_open_model } = useModalHandler();
const handleEdit = (record: any) => {
handel_open_model(ModalEnum?.CHANGE_PASSWORD);
};
return ( return (
<div className="NavBar"> <div className="NavBar">
<span className="navbar_link" onClick={handelNavigate}> <span className="navbar_link" onClick={handelNavigate}>
<MdOutlineArrowForwardIos /> {PageTitle} <MdOutlineArrowForwardIos /> {Page_title}
</span> </span>
<NavBarRightSide/> <article>
<Suspense fallback={<SpinContainer/>}> <div className="header_search">
{/* <NavBarSelect /> */}
<SearchField
options={translateArray}
placeholder={t("practical.search_here")}
/>
</div>
<span className="header_icons">
<div>
<Image src="/Icon/bell.png" />
</div>
<Tooltip
placement="top"
title={
<div onClick={handleEdit}>
{" "}
{t("header.change_your_current_password")}{" "}
</div>
}
color="#E0E0E0"
>
<div className="gear">
<Image src="/Icon/gear.png" />
</div>
</Tooltip>
</span>
<div className="header_profile">
<span>
<h6>{userData?.username}</h6>
<p>{userData?.type}</p>
</span>
<Image src="/Layout/DefultStudentImage.png" />
</div>
</article>
<ChangePasswordModel /> <ChangePasswordModel />
</Suspense>
</div> </div>
); );
}; };

View File

@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom";
function NotFoundPage() { function NotFoundPage() {
const navigate = useNavigate(); const navigate = useNavigate();
return ( return (
<div className="not_found_page"> <div className="not_foound_page">
<div className="container-not-found"> <div className="container-not-found">
<p> <p>
404 <h6>|</h6>This page could not be found 404 <h6>|</h6>This page could not be found

View File

@ -1,16 +1,72 @@
import React from "react"; import React, { useState } from "react";
import { Divider } from "antd"; import { Divider } from "antd";
import { useLocation, useNavigate } from "react-router-dom"; import { Link, useLocation, useNavigate } from "react-router-dom";
import { menuItems } from "../../Routes"; import { menuItems } from "../../Routes";
import { MdLogout } from "react-icons/md"; import { MdLogout, MdExpandMore, MdExpandLess } from "react-icons/md";
import useAuthState from "../../zustand/AuthState"; import useAuthState from "../../zustand/AuthState";
import { hasAbility } from "../../utils/hasAbility"; import { hasAbility } from "../../utils/hasAbility";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { getLocalStorage } from "../../utils/LocalStorage"; import { getLocalStorage } from "../../utils/LocalStorage";
import { BRANCH_OBJECT_KEY } from "../../config/AppKey"; import { BRANCH_OBJECT_KEY } from "../../config/AppKey";
import { MenuItem } from "../../Components/Layout/SideBar/MenuItem";
const MenuItem = ({ item, location, index }: any) => {
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
// console.log(location.pathname.split("/")[1]);
const [openDropdown, setOpenDropdown] = useState<number | null>(null);
const handleDropdown = (index: number) => {
setOpenDropdown((prev) => (prev === index ? null : index));
};
const isDropdownOpen = openDropdown === index;
const [t] = useTranslation();
const navigate = useNavigate();
return (
<>
<div
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"} `}
onClick={() => navigate(item.path || "/")}
>
<i>{item.icon}</i>
<Link to={item.path || "/"}>{t(item.text)}</Link>
{item?.children && (
<>
{isDropdownOpen ? (
<div
className="DropDownIcon"
onClick={() => handleDropdown(index)}
>
<MdExpandLess />
</div>
) : (
<div
className="DropDownIcon"
onClick={() => handleDropdown(index)}
>
<MdExpandMore />
</div>
)}
</>
)}
</div>
{item?.children && isDropdownOpen && (
<div className="sub-menu">
{item.children.map((childItem: any, index: any) => (
<MenuItem
key={index}
item={childItem}
location={location}
index={index}
/>
))}
</div>
)}
</>
);
};
const SideBar = () => { const SideBar = () => {
const location = useLocation(); const location = useLocation();

View File

@ -5,6 +5,7 @@ import FormikForm from "../../../Layout/Dashboard/FormikFormModel";
import ModelBody from "./Add"; import ModelBody from "./Add";
import { getInitialValues, getValidationSchema } from "./formUtil"; import { getInitialValues, getValidationSchema } from "./formUtil";
import { ModalEnum } from "../../../enums/Model"; import { ModalEnum } from "../../../enums/Model";
import { useParams } from "react-router-dom";
import { useObjectToEdit } from "../../../zustand/ObjectToEditState"; import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUpdateAdmin } from "../../../api/users"; import { useUpdateAdmin } from "../../../api/users";

View File

@ -26,7 +26,7 @@ const TableHeader = () => {
"/" + "/" +
`${SubjectName}` + `${SubjectName}` +
"/" + "/" +
t(`PageTitle.unit`) + t(`page_title.unit`) +
"/" + "/" +
`${unitName}`, `${unitName}`,
); );

View File

@ -59,15 +59,15 @@ const AddPage: React.FC = () => {
"/" + "/" +
`${SubjectName}` + `${SubjectName}` +
"/" + "/" +
t(`PageTitle.unit`) + t(`page_title.unit`) +
"/" + "/" +
`${unitName}` + `${unitName}` +
"/" + "/" +
t(`PageTitle.lesson`) + t(`page_title.lesson`) +
"/" + "/" +
`${lessonName}` + `${lessonName}` +
"/" + "/" +
t(`PageTitle.questions`), t(`page_title.questions`),
); );
const handleSubmit = ( const handleSubmit = (

View File

@ -70,15 +70,15 @@ const EditPage: React.FC = () => {
"/" + "/" +
`${SubjectName}` + `${SubjectName}` +
"/" + "/" +
t(`PageTitle.unit`) + t(`page_title.unit`) +
"/" + "/" +
`${unitName}` + `${unitName}` +
"/" + "/" +
t(`PageTitle.lesson`) + t(`page_title.lesson`) +
"/" + "/" +
`${lessonName}` + `${lessonName}` +
"/" + "/" +
t(`PageTitle.questions`), t(`page_title.questions`),
); );
const handleSubmit = (values: any) => { const handleSubmit = (values: any) => {

View File

@ -24,15 +24,15 @@ const TableHeader = () => {
"/" + "/" +
`${SubjectName}` + `${SubjectName}` +
"/" + "/" +
t(`PageTitle.unit`) + t(`page_title.unit`) +
"/" + "/" +
`${unitName}` + `${unitName}` +
"/" + "/" +
t(`PageTitle.lesson`) + t(`page_title.lesson`) +
"/" + "/" +
`${lessonName}` + `${lessonName}` +
"/" + "/" +
t(`PageTitle.questions`), t(`page_title.questions`),
); );
return ( return (

View File

@ -1,12 +1,12 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { FaArrowRight, FaPlus } from "react-icons/fa"; import { FaArrowRight, FaPlus } from "react-icons/fa";
import { useButtonState } from "../../../zustand/ButtonState"; import { useButtonState } from "../../../zustand/ButtonState";
import { usePageTitleState } from "../../../zustand/PageTitleState"; import { usePage_titleState } from "../../../zustand/PageTitleState";
const FillterNavWithRadio = () => { const FillterNavWithRadio = () => {
const [activeButton, setActiveButton] = useState(0); const [activeButton, setActiveButton] = useState(0);
const { setActiveTab } = useButtonState((state) => state); const { setActiveTab } = useButtonState((state) => state);
const { title } = usePageTitleState(); const { title } = usePage_titleState();
// Function to handle button click // Function to handle button click
const handleButtonClick = (index: number) => { const handleButtonClick = (index: number) => {

View File

@ -1,25 +1,36 @@
import QueryProvider from "./lib/ReactQueryProvider"; import QueryProvider from "./lib/ReactQueryProvider";
import { BrowserRouter } from "react-router-dom"; import { BrowserRouter } from "react-router-dom";
import { ChildrenType } from "./types/App"; import { Tchildren } from "./types/App";
import ToastProvider from "./lib/ToastProvider"; import ToastProvider from "./lib/ToastProvider";
import AntdProvider from "./lib/AntdProvider"; import { ConfigProvider } from "antd";
import I18nProvider from "./lib/I18nProvider";
function ProviderContainer({ children }: Tchildren) {
const primaryColor = "#3182ce";
const bgColor = "rgb(255, 255, 255)";
function ProviderContainer({ children }: ChildrenType) {
return ( return (
<BrowserRouter basename="/"> <BrowserRouter basename="/">
<I18nProvider> {/* <ReduxT> */}
<QueryProvider> <QueryProvider>
<ToastProvider> <ToastProvider>
<AntdProvider> <ConfigProvider
theme={{
token: {
colorPrimary: primaryColor,
},
components: {
Table: {
headerBg: bgColor,
headerColor: primaryColor,
},
},
}}
>
{children} {children}
</AntdProvider> </ConfigProvider>
</ToastProvider> </ToastProvider>
</QueryProvider> </QueryProvider>
{/* </ReduxT> */}
</I18nProvider>
</BrowserRouter> </BrowserRouter>
); );
} }

View File

@ -1,6 +1,9 @@
import { TCrudRoute, TMenuItem } from "./types/App"; import { TCrudRoute, TMenuItem } from "./types/App";
import { FaHome, FaMoneyBill } from "react-icons/fa"; import { FaHome, FaMoneyBill, FaUser } from "react-icons/fa";
import React from "react"; import { ImBooks } from "react-icons/im";
import React, { lazy } from "react";
// import Home from "./Pages/Home/Page";
const Dummy = React.lazy(() => import("./Pages/Home/Dummy")); const Dummy = React.lazy(() => import("./Pages/Home/Dummy"));
const Subject = React.lazy(() => import("./Pages/subject/Table/Page")); const Subject = React.lazy(() => import("./Pages/subject/Table/Page"));
@ -13,6 +16,10 @@ const Question = React.lazy(() => import("./Pages/question/Page"));
const AddQuestionPage = React.lazy(() => import("./Pages/question/AddPage")); const AddQuestionPage = React.lazy(() => import("./Pages/question/AddPage"));
const EditQuestionPage = React.lazy(() => import("./Pages/question/EditPage")); const EditQuestionPage = React.lazy(() => import("./Pages/question/EditPage"));
// const QuestionChildren = React.lazy(() => import('./Pages/question/children/Page'))
// const AddQuestionChildren = React.lazy(() => import('./Pages/question/children/Model/AddModel'))
// const EditQuestionChildren = React.lazy(() => import('./Pages/question/children/Model/EditModel'))
import { hasAbility } from "./utils/hasAbility"; import { hasAbility } from "./utils/hasAbility";
import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "./enums/abilities"; import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "./enums/abilities";
import { ParamsEnum } from "./enums/params"; import { ParamsEnum } from "./enums/params";

View File

@ -36,7 +36,7 @@ svg {
cursor: pointer; cursor: pointer;
} }
.not_found_page { .not_foound_page {
background: black; background: black;
height: 100vh; height: 100vh;
display: flex; display: flex;

View File

@ -88,7 +88,7 @@
display: none !important; display: none !important;
} }
.ShowMoreButton { .Show_More_Button {
position: absolute; position: absolute;
bottom: 1vw; bottom: 1vw;
right: 0.5vw; right: 0.5vw;

View File

@ -9,14 +9,14 @@
.absence_icon { .absence_icon {
background-color: red; background-color: red;
} }
.late_arrival_icon { .lateArrival_icon {
background-color: orange; background-color: orange;
} }
.presence_icon { .presence_icon {
background-color: #31ce83 !important; background-color: #31ce83 !important;
} }
.earlyDepartureDetails { .earlyDeparture_Details {
// color: gray; // color: gray;
svg { svg {
color: #a098ae; color: #a098ae;
@ -33,7 +33,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.custom_add_button_column_mark { .custom_add_button_column_Mark {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -46,7 +46,7 @@
// font-size: 7px; // font-size: 7px;
// } // }
.column_student_block { .column_studentBlock {
width: 20px; width: 20px;
height: 20px; height: 20px;
border-radius: 4px; border-radius: 4px;
@ -72,16 +72,16 @@
border: 2px solid var(--absence); border: 2px solid var(--absence);
} }
.earlyDepartureStudent { .earlyDeparture_student {
background-color: var(--earlyDeparture); background-color: var(--earlyDeparture);
} }
.not_earlyDepartureStudent { .not_earlyDeparture_student {
border: 2px solid var(--earlyDeparture); border: 2px solid var(--earlyDeparture);
} }
.lateArrivalStudent { .lateArrival_student {
background-color: var(--lateArrival); background-color: var(--lateArrival);
} }
.notLateArrivalStudent { .not_lateArrival_student {
border: 2px solid var(--lateArrival); border: 2px solid var(--lateArrival);
} }

View File

@ -2,7 +2,7 @@
display: none !important; display: none !important;
} }
.ShowMoreButton { .Show_More_Button {
position: absolute; position: absolute;
bottom: 1vw; bottom: 1vw;
right: 0.5vw; right: 0.5vw;
@ -64,13 +64,24 @@
} }
} }
.activeModelTab { .activeModeltab {
> div { > div {
background: #bfe2fd; background: #bfe2fd;
color: black; color: black;
} }
} }
&::after {
z-index: 1;
position: absolute;
bottom: 0;
right: -2.4vw;
content: "";
background: url("../../../public/Icon/cercile.svg");
width: 15vw;
height: 15vw;
background-repeat: no-repeat;
}
} }
.ModelBodyForm { .ModelBodyForm {
padding: 2vw; padding: 2vw;

View File

@ -6,7 +6,7 @@
@import "./Course.scss"; @import "./Course.scss";
@import "./EduClass.scss"; @import "./EduClass.scss";
@import "./programme.scss"; @import "./programme.scss";
@import "./Columns.scss"; @import "./Coulmns.scss";
@import "./subject.scss"; @import "./subject.scss";
@import "./Marks.scss"; @import "./Marks.scss";
@import "./exercise.scss"; @import "./exercise.scss";

View File

@ -10,6 +10,8 @@ function useAddMutation(
toast: boolean = true, toast: boolean = true,
): UseMutationResult<AxiosResponse, unknown, any, unknown> { ): UseMutationResult<AxiosResponse, unknown, any, unknown> {
const axios = useAxios(); const axios = useAxios();
console.log(toast, key);
return useMutation<AxiosResponse, unknown, any, unknown>( return useMutation<AxiosResponse, unknown, any, unknown>(
async (dataToSend) => { async (dataToSend) => {
const filterDataToSend = filterData(dataToSend); const filterDataToSend = filterData(dataToSend);

View File

@ -1,4 +1,8 @@
import {
BRANCH_OBJECT_KEY,
CYCLE_OBJECT_KEY,
TERM_OBJECT_KEY,
} from "../../config/AppKey";
import useAuthState from "../../zustand/AuthState"; import useAuthState from "../../zustand/AuthState";
import { BaseURL, HEADER_KEY } from "../config"; import { BaseURL, HEADER_KEY } from "../config";
import AxiosBuilder from "./AxiosBuilder"; import AxiosBuilder from "./AxiosBuilder";
@ -8,6 +12,7 @@ import { useQueryClient } from "react-query";
import { useValidationState } from "../../Components/ValidationField/utils/ValidationState"; import { useValidationState } from "../../Components/ValidationField/utils/ValidationState";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { AxiosQueryEnum, AxiosStatusEnum } from "../../enums/Axios"; import { AxiosQueryEnum, AxiosStatusEnum } from "../../enums/Axios";
import { getLocalStorage } from "../../utils/LocalStorage";
function useAxios() { function useAxios() {
const { isAuthenticated, token } = useAuthState(); const { isAuthenticated, token } = useAuthState();
@ -38,6 +43,7 @@ function useAxios() {
const key = response.config.headers[HEADER_KEY]; const key = response.config.headers[HEADER_KEY];
const isToasted = response.config.headers["X-Custom-Message"]; const isToasted = response.config.headers["X-Custom-Message"];
console.log(isToasted);
const ResponseMessage = const ResponseMessage =
responseMsg || t("validation.the_possess_done_successful"); responseMsg || t("validation.the_possess_done_successful");

View File

@ -1,7 +0,0 @@
export enum LocalStorageEnum {
PROJECT_NAME = 'SCHOOL_DASHBOARD_EXERCISE',
LANGUAGE_KEY = LocalStorageEnum.PROJECT_NAME + '_LANGUAGE',
TOKEN_KEY = LocalStorageEnum.PROJECT_NAME + '_TOKEN_KEY',
USER_KEY = LocalStorageEnum.PROJECT_NAME + '_USER_KEY',
}

View File

@ -1,8 +1,10 @@
import App from "./App"; import App from "./App";
import "bootstrap/dist/css/bootstrap.min.css"; import "bootstrap/dist/css/bootstrap.min.css";
import "./Styles/App/index.scss"; import "./Styles/App/index.scss";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import ProviderContainer from "./ProviderContainer"; import ProviderContainer from "./ProviderContainer";
import i18n from "i18next";
const root = createRoot(document.getElementById("root") as HTMLElement); const root = createRoot(document.getElementById("root") as HTMLElement);
root.render( root.render(

View File

@ -1,26 +0,0 @@
import { ConfigProvider } from 'antd';
function AntdProvider({ children }: { children: React.ReactNode }) {
const primaryColor = "#3182ce";
const bgColor = "rgb(255, 255, 255)";
return (
<ConfigProvider
theme={{
token: {
colorPrimary: primaryColor,
},
components: {
Table: {
headerBg: bgColor,
headerColor: primaryColor,
},
},
}}
>
{children}
</ConfigProvider>
);
}
export default AntdProvider;

View File

@ -1,13 +0,0 @@
import React, { ReactNode } from 'react';
import { I18nextProvider } from 'react-i18next';
import i18n from './i18nConfig'; // Import the configured i18n instance
interface I18nProviderProps {
children: ReactNode;
}
const I18nProvider: React.FC<I18nProviderProps> = ({ children }) => {
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;
};
export default I18nProvider;

View File

@ -1,26 +0,0 @@
import { useNavigate } from "react-router-dom";
import useAuthState from "../zustand/AuthState";
import { useEffect } from "react";
interface ProtectedRouteProviderProps extends React.HTMLProps<HTMLDivElement> {
children: React.ReactNode;
}
function ProtectedRouteProvider({ children, ...props }: ProtectedRouteProviderProps) {
const navigate = useNavigate();
const { isAuthenticated } = useAuthState();
useEffect(() => {
if (!isAuthenticated) {
navigate("/auth");
}
}, [isAuthenticated, navigate]);
return (
<div {...props}>
{children}
</div>
);
}
export default ProtectedRouteProvider;

View File

@ -1,19 +0,0 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import translationAR from '../translate/ar.json';
const resources = {
ar: {
translation: translationAR,
},
};
i18n.use(initReactI18next).init({
resources,
lng: 'ar', // Set the default language
interpolation: {
escapeValue: false,
},
});
export default i18n;

View File

@ -656,7 +656,7 @@
"some_thing_went_wrong": "حدث خطأ ما", "some_thing_went_wrong": "حدث خطأ ما",
"the_possess_done_successful": "تمت العملية بنجاح" "the_possess_done_successful": "تمت العملية بنجاح"
}, },
"PageTitle": { "page_title": {
"main_page": "الصفحة الرئيسية", "main_page": "الصفحة الرئيسية",
"course": "الصفوف", "course": "الصفوف",
"education_class": "الشعب", "education_class": "الشعب",

612
src/translate/en.json Normal file
View File

@ -0,0 +1,612 @@
{
"main_page": "Main Page",
"dashboard": "dashboard",
"validation": {
"required": "required",
"value_must_be_less_than_900000": "value_must_be_less_than_900000",
"type_required": "type_required",
"pleas_fill_all_label": "pleas Fill All Label",
"please_select_students": "please_select_students",
"please_fill_in_all_the_fields": "please_fill_in_all_the_fields",
"Invalid_email": "Invalid_email",
"Email_is_required": "Email_is_required",
"Password_is_required": "Password_is_required",
"Password_must_be_at_least_8_characters_long": "Password_must_be_at_least_8_characters_long",
"Nationality_is_required": "Nationality_is_required",
"Address_is_required": "Address_is_required",
"Place_of_birth_is_required": "Place_of_birth_is_required",
"Date_of_birth_is_required": "Date_of_birth_is_required",
"Mother's_name_is_required": "Mother's_name_is_required",
"Father's_name_is_required": "Father's_name_is_required",
"Last_name_is_required": "Last_name_is_required",
"First_name_is_required": "First_name_is_required",
"Religion_is_required": "Religion_is_required",
"Gender_is_required": "Gender_is_required",
"Attachment1_is_required": "Attachment1_is_required",
"Father's_job_is_required": "Father's_job_is_required",
"Mother's_phone_number_is_required": "Mother's_phone_number_is_required",
"Father's_phone_number_is_required": "Father's_phone_number_is_required",
"Mother's_job_is_required": "Mother's_job_is_required",
"justification_is_required": "justification_is_required",
"duration_is_required": "duration_is_required",
"pleas_do_any_changes": "pleas_do_any_changes",
"edit_session_content": "edit_session_content",
"Title_is_required": "Title_is_required",
"Exam_type_is_required": "Exam_type_is_required",
"Subject_is_required": "Subject_is_required",
"Maximum_grade_is_required": "Maximum_grade_is_required",
"Must_be_a_number": "Must_be_a_number",
"Value_must_not_exceed_10000": "Value_must_not_exceed_10000",
"Passing_grade_is_required": "Passing_grade_is_required",
"Date_is_required": "Date_is_required",
"Duration_is_required": "Duration_is_required",
"the_possess_done_successful": "the_possess_done_successful",
"some_thing_went_wrong": "some_thing_went_wrong",
"Due_date_must_be_before_assigning_date": "Due date must be before assigning date"
},
"header": {
"register_students": "register_students",
"import_students": "import_students",
"move_student": "move_student",
"Student_added_successfully": "Student_added_successfully",
"the_student_has_been_added_Do_you_want_to_add_another_student": "the_student_has_been_added_Do_you_want_to_add_another_student",
"Add_a_new_student": "Add_a_new_student",
"Please enter all required data": "Please enter all required data",
"Back to Previous Step": "Back to Previous Step",
"Adding...": "Adding...",
"Next Step": "Next Step",
"Add Student": "Add Student",
"Attendance and absence of students": "Attendance and absence of students",
"see_more_details": "see_more_details",
"earlyDepartures": "earlyDepartures",
"Follow_the_curriculum": "Follow_the_curriculum",
"add_session_content": "add_session_content",
"add_session": "add_session",
"edit_session": "edit_session",
"classroom_behavior_of_students": "classroom_behavior_of_students",
"note_details": "note_details",
"student_homework": "student_homework",
"home_work_title": "home_work_title",
"subject": "subject",
"max_grade": "max_grade",
"student_count": "student_count",
"student_exam": "student_exam",
"student_name": "student_name",
"student_card": "student_card",
"Student_classroom_behavior": "Student_classroom_behavior",
"The_student_financial_situation": "The_student_financial_situation",
"Modify_student_information": "Modify_student_information",
"student_details": "student_details",
"student_status": "student_status",
"parent_details": "parent_details",
"contact_details": "contact_details",
"additional_details": "additional_details",
"note_type": "note_type",
"student_payment": "student_payment",
"add_new_unit": "add_new_unit",
"add_new_lessons": "add_new_lessons",
"Student_Information": "Student_Information",
"Parent_Information": "Parent_Information",
"Contact_Information": "Contact_Information",
"Attachment_Images": "Attachment_Images",
"Weekly_Class_Schedule": "Weekly_Class_Schedule",
"Print_Schedule": "Print_Schedule",
"Welcome": "Welcome",
"Enter your email and password to log in": "Enter your email and password to log in",
"change_your_current_password": "change your current password",
"view_cycle_for_this_branch": "view cycle for this branch",
"view_term_for_this_cycle": "view term for this branch"
},
"columns": {
"id": "id",
"name": "name",
"address": "address",
"contact_information": "contact_information",
"data": "data",
"details": "details",
"receipt_number": "receipt_number",
"payment_type": "payment_type",
"value": "value",
"subject_name": "subject_name",
"image": "image",
"card": "card",
"birthday": "birthday",
"last_name": "last_name",
"father_name": "father_name",
"sex": "sex",
"presence": "presence",
"teacher_name": "teacher_name",
"lesson_name": "lesson_name",
"session_start": "session_start",
"type": "type",
"title": "title",
"content": "content",
"assigning_date": "assigning_date",
"due_date": "due_date",
"mark": "mark",
"student_name": "student_name",
"absence": "absence",
"earlyDeparture": "earlyDeparture",
"lateArrival": "lateArrival",
"date": "date",
"starting_date": "starting_date",
"ending_date": "ending_date",
"term_type": "term_type",
"status": "status"
},
"practical": {
"to_confirm_deletion_please_re_enter": "To confirm deletion, please re-enter",
"back": "back",
"add": "add",
"edit": "edit",
"move": "move",
"skip": "skip",
"show": "show",
"save": "save",
"enter": "enter",
"delete": "delete",
"cancel": "cancel",
"search_here": "search_here",
"details": "details",
"export_students": "export_students",
"send_notification_to_course": "send_notification_to_course",
"Send_Direct_Notification": "Send_Direct_Notification",
"cancel_registration": "cancel_registration",
"send_notification_to_education_class": "send_notification_to_education_class",
"send_notification_to_student": "send_notification_to_student",
"status": "status",
"Step": "Step",
"login": "login",
"submite": "submite",
"index": "index",
"store": "store",
"update": "update",
"me": "me",
"importStudentData": "importStudentData",
"moveStudents": "moveStudents",
"importStudents": "importStudents",
"overview": "overview",
"presence": "presence"
},
"Table": {
"header": "",
"info": ""
},
"models": {
"teacher": "teacher",
"student": "student",
"students": "students",
"subject": "subject",
"education_class": "education_class",
"eduClass": "education_class",
"session_content": "session_content",
"course": "course",
"payment": "payment",
"note": "note",
"homework": "homework",
"mark": "mark",
"exam": "exam",
"absence": "absence",
"late_arrival": "late_arrival",
"presence": "presence",
"earlyDeparture": "earlyDeparture",
"branch": "branch",
"cycle": "cycle",
"term": "term",
"role": "role",
"Pass": "Pass",
"user": "User",
"branchAdmin": "Branch Admin",
"grade": "Grade",
"homeworkAttachment": "Homework Attachment",
"lateArrival": "Late Arrival",
"noteAttachment": "Note Attachment",
"session": "Session",
"sessionContent": "Session Content",
"subjectAttachment": "Subject Attachment",
"unit": "Unit",
"lesson": "Lesson",
"exercise": "Exercise",
"exerciseAnswer": "Exercise Answer",
"tag": "Tag",
"Exam": "Exam",
"ExamType": "Exam Type",
"studentParent": "Student Parent",
"registrationRecord": "Registration Record",
"paymentOverview": "Payment Overview",
"subjectAttachmentType": "Subject Attachment Type",
"param": "Param",
"subjectProgress": "Subject Progress",
"main_page": "Main Page"
},
"education_class_actions": {
"Student_Records": "Student_Records",
"Attendance": "Attendance",
"Permissions": "Permissions",
"Grades": "Grades",
"Notes": "Notes",
"Financial_Status": "Financial_Status",
"Assignments": "Assignments",
"Class_Schedule": "Class_Schedule",
"Curriculum_Follow_up": "Curriculum_Follow_up"
},
"input": {
"name": "name",
"address": "address",
"number": "number",
"price": "price",
"drag_and_drop_or_click_here_to_select_the_file": "Drag and drop or click here to select the file",
"Click_to_upload_the_image": "Click to upload the image",
"payment_type": "payment_type",
"details": "details",
"student_name": "student_name",
"receipt_number": "receipt_number",
"date": "date",
"value": "value",
"teacher_name": "teacher_name",
"sex": "sex",
"content": "content",
"type": "type",
"attachments": "attachments",
"send_notification_to_course": "send_notification_to_course",
"export_students": "export_students",
"password": "password",
"nationality": "nationality",
"religion": "religion",
"birthday": "birthday",
"birth_place": "birth_place",
"father_name": "father_name",
"father_job": "father_job",
"mother_name": "mother_name",
"mother_phone_number": "mother_phone_number",
"father_phone_number": "father_phone_number",
"mother_job": "mother_job",
"phone_number": "phone_number",
"additional_phone_number": "additional_phone_number",
"note": "note",
"school_document": "school_document",
"first_name": "first_name",
"last_name": "last_name",
"email": "email",
"student_status": "student_status",
"duration": "duration",
"justification": "justification",
"attachment": "attachment",
"session_name": "session_name",
"lesson_name": "lesson_name",
"title": "title",
"due_date": "due_date",
"assigning_date": "assigning_date",
"subject_name": "subject_name",
"exam_type": "exam_type",
"grade_to_pass": "grade_to_pass",
"max_grade": "max_grade",
"status": "status",
"departure_time": "departure_time",
"mark": "mark",
"image": "image",
"term": "term",
"session_start": "session_start",
"session_end": "session_end",
"academic_year": "academic_year",
"select_date": "select_date",
"School_Year": "School Year",
"Enter_branch_first": "Enter branch first",
"School_Term": "School Term",
"Enter_school_year_first": "Enter school year first",
"Username": "Username",
"Password": "Password",
"new_password": "new_password",
"old_password": "old_password",
"username": "username",
"starting_date": "starting_date",
"ending_date": "ending_date",
"term_type": "term_type",
"description": "description",
"abilities": "abilities"
},
"select": {
"Payments": {
"paid": "paid",
"to_be_paid": "to_be_paid",
"all_payment": "all_payment",
"dues": "dues"
},
"Marks": {
"Not_Taken": "Not_Taken",
"Taken": "Taken"
},
"Sex": {
"male": "male",
"female": "female",
"bi": "mix"
},
"Religion": {
"muslim": "muslim",
"christianity": "christianity",
"other": "other"
},
"nationalities": {
"Afghan": "Afghan",
"Albanian": "Albanian",
"Algerian": "Algerian",
"American": "American",
"Andorran": "Andorran",
"Angolan": "Angolan",
"Antiguans": "Antiguans",
"Argentinean": "Argentinean",
"Armenian": "Armenian",
"Australian": "Australian",
"Austrian": "Austrian",
"Azerbaijani": "Azerbaijani",
"Bahamian": "Bahamian",
"Bahraini": "Bahraini",
"Bangladeshi": "Bangladeshi",
"Barbadian": "Barbadian",
"Barbudans": "Barbudans",
"Batswana": "Batswana",
"Belarusian": "Belarusian",
"Belgian": "Belgian",
"Belizean": "Belizean",
"Beninese": "Beninese",
"Bhutanese": "Bhutanese",
"Bolivian": "Bolivian",
"Bosnian": "Bosnian",
"Brazilian": "Brazilian",
"British": "British",
"Bruneian": "Bruneian",
"Bulgarian": "Bulgarian",
"Burkinabe": "Burkinabe",
"Burmese": "Burmese",
"Burundian": "Burundian",
"Cambodian": "Cambodian",
"Cameroonian": "Cameroonian",
"Canadian": "Canadian",
"Cape Verdean": "Cape Verdean",
"Central African": "Central African",
"Chadian": "Chadian",
"Chilean": "Chilean",
"Chinese": "Chinese",
"Colombian": "Colombian",
"Comoran": "Comoran",
"Congolese": "Congolese",
"Costa Rican": "Costa Rican",
"Croatian": "Croatian",
"Cuban": "Cuban",
"Cypriot": "Cypriot",
"Czech": "Czech",
"Danish": "Danish",
"Djibouti": "Djibouti",
"Dominican": "Dominican",
"Dutch": "Dutch",
"East Timorese": "East Timorese",
"Ecuadorean": "Ecuadorean",
"Egyptian": "Egyptian",
"Emirian": "Emirian",
"Equatorial Guinean": "Equatorial Guinean",
"Eritrean": "Eritrean",
"Estonian": "Estonian",
"Ethiopian": "Ethiopian",
"Fijian": "Fijian",
"Filipino": "Filipino",
"Finnish": "Finnish",
"French": "French",
"Gabonese": "Gabonese",
"Gambian": "Gambian",
"Georgian": "Georgian",
"German": "German",
"Ghanaian": "Ghanaian",
"Greek": "Greek",
"Grenadian": "Grenadian",
"Guatemalan": "Guatemalan",
"Guinea-Bissauan": "Guinea-Bissauan",
"Guinean": "Guinean",
"Guyanese": "Guyanese",
"Haitian": "Haitian",
"Herzegovinian": "Herzegovinian",
"Honduran": "Honduran",
"Hungarian": "Hungarian",
"I-Kiribati": "I-Kiribati",
"Icelander": "Icelander",
"Indian": "Indian",
"Indonesian": "Indonesian",
"Iranian": "Iranian",
"Iraqi": "Iraqi",
"Irish": "Irish",
"palestine": "palestine",
"Italian": "Italian",
"Ivorian": "Ivorian",
"Jamaican": "Jamaican",
"Japanese": "Japanese",
"Jordanian": "Jordanian",
"Kazakhstani": "Kazakhstani",
"Kenyan": "Kenyan",
"Kittian and Nevisian": "Kittian and Nevisian",
"Kuwaiti": "Kuwaiti",
"Kyrgyz": "Kyrgyz",
"Laotian": "Laotian",
"Latvian": "Latvian",
"Lebanese": "Lebanese",
"Liberian": "Liberian",
"Libyan": "Libyan",
"Liechtensteiner": "Liechtensteiner",
"Lithuanian": "Lithuanian",
"Luxembourger": "Luxembourger",
"Macedonian": "Macedonian",
"Malagasy": "Malagasy",
"Malawian": "Malawian",
"Malaysian": "Malaysian",
"Maldivan": "Maldivan",
"Malian": "Malian",
"Maltese": "Maltese",
"Marshallese": "Marshallese",
"Mauritanian": "Mauritanian",
"Mauritian": "Mauritian",
"Mexican": "Mexican",
"Micronesian": "Micronesian",
"Moldovan": "Moldovan",
"Monacan": "Monacan",
"Mongolian": "Mongolian",
"Moroccan": "Moroccan",
"Mosotho": "Mosotho",
"Motswana": "Motswana",
"Mozambican": "Mozambican",
"Namibian": "Namibian",
"Nauruan": "Nauruan",
"Nepali": "Nepali",
"New Zealander": "New Zealander",
"Nicaraguan": "Nicaraguan",
"Nigerian": "Nigerian",
"Nigerien": "Nigerien",
"North Korean": "North Korean",
"Northern Irish": "Northern Irish",
"Norwegian": "Norwegian",
"Omani": "Omani",
"Pakistani": "Pakistani",
"Palauan": "Palauan",
"Panamanian": "Panamanian",
"Papua New Guinean": "Papua New Guinean",
"Paraguayan": "Paraguayan",
"Peruvian": "Peruvian",
"Polish": "Polish",
"Portuguese": "Portuguese",
"Qatari": "Qatari",
"Romanian": "Romanian",
"Russian": "Russian",
"Rwandan": "Rwandan",
"Saint Lucian": "Saint Lucian",
"Salvadoran": "Salvadoran",
"Samoan": "Samoan",
"San Marinese": "San Marinese",
"Sao Tomean": "Sao Tomean",
"Saudi": "Saudi",
"Scottish": "Scottish",
"Senegalese": "Senegalese",
"Serbian": "Serbian",
"Seychellois": "Seychellois",
"Sierra Leonean": "Sierra Leonean",
"Singaporean": "Singaporean",
"Slovakian": "Slovakian",
"Slovenian": "Slovenian",
"Solomon Islander": "Solomon Islander",
"Somali": "Somali",
"South African": "South African",
"South Korean": "South Korean",
"Spanish": "Spanish",
"Sri Lankan": "Sri Lankan",
"Sudanese": "Sudanese",
"Surinamer": "Surinamer",
"Swazi": "Swazi",
"Swedish": "Swedish",
"Swiss": "Swiss",
"Syrian": "Syrian",
"Taiwanese": "Taiwanese",
"Tajik": "Tajik",
"Tanzanian": "Tanzanian",
"Thai": "Thai",
"Togolese": "Togolese",
"Tongan": "Tongan",
"Trinidadian/Tobagonian": "Trinidadian/Tobagonian",
"Tunisian": "Tunisian",
"Turkish": "Turkish",
"Tuvaluan": "Tuvaluan",
"Ugandan": "Ugandan",
"Ukrainian": "Ukrainian",
"Uruguayan": "Uruguayan",
"Uzbekistani": "Uzbekistani",
"Venezuelan": "Venezuelan",
"Vietnamese": "Vietnamese",
"Welsh": "Welsh",
"Yemenite": "Yemenite",
"Zambian": "Zambian",
"Zimbabwean": "Zimbabwean"
},
"Student_Type": {
"all_students": "all_students",
"absence": "absence",
"late_arrival": "late_arrival",
"presence": "presence",
"justified": "justified",
"not_justified": "not_justified",
"earlyDeparture": "earlyDeparture"
},
"Note": {
"normal_note": "normal_note",
"alert_note": "alert_note",
"financial_note": "financial_note",
"positive_note": "positive_note",
"warning_note": "warning_note",
"academic_note": "academic_note",
"studying_note": "studying_note",
"organization_note": "organization_note",
"all_note": "all_note"
},
"Exam": {
"Taken": "Taken",
"Not_Taken": "Not_Taken",
"all_student": "all_student"
},
"Term_type": {
"first": "first",
"second": "second"
}
},
"array": {
"Period": {
"Today": "Today",
"First": "First",
"Second": "Second",
"Third": "Third",
"Fourth": "Fourth",
"Fifth": "Fifth",
"Sixth": "Sixth",
"Seventh": "Seventh"
},
"Days": {
"Sunday": "Sunday",
"Monday": "Monday",
"Tuesday": "Tuesday",
"Wednesday": "Wednesday",
"Thursday": "Thursday",
"Friday": "Friday",
"Saturday": "Saturday"
},
"UserInfo": {
"course": "course",
"education_class": "education_class",
"nationality": "nationality",
"birthday": "birthday",
"warning": "warning",
"appreciation": "appreciation",
"alert": "alert"
}
},
"sidebar": {
"dashboard": "dashboard",
"course": "course",
"teacher": "teacher",
"payment": "payment",
"student_details": "student_details",
"create_student": "create_student",
"course_details": "course_details",
"education_class_details": "education_class_details",
"subject_details": "subject_details",
"logout": "logout",
"branch": "branch",
"role": "role"
},
"message": {
"some_thing_went_wrong": "some_thing_went_wrong",
"the_possess_done_successful": "the_possess_done_successful"
}
}

View File

@ -2,7 +2,7 @@ import { ReactElement, LazyExoticComponent, ReactNode } from "react";
import { Mark_State, Payment_type, term_type } from "./Item"; import { Mark_State, Payment_type, term_type } from "./Item";
import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "../enums/abilities"; import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "../enums/abilities";
export type ChildrenType = { export type Tchildren = {
children: ReactNode; children: ReactNode;
}; };

View File

@ -3,7 +3,7 @@ export const getLocalStorage = (key: string) => {
const data = localStorage?.getItem(key); const data = localStorage?.getItem(key);
return data ? JSON.parse(data) : null; return data ? JSON.parse(data) : null;
} catch (error) { } catch (error) {
// console.error("Error parsing JSON from localStorage", error); console.error("Error parsing JSON from localStorage", error);
return null; return null;
} }
}; };

View File

@ -1,6 +1,5 @@
import { create } from "zustand"; import { create } from "zustand";
import { ABILITIES_KEY, TOKEN_KEY, USER_KEY } from "../config/AppKey"; import { ABILITIES_KEY, TOKEN_KEY, USER_KEY } from "../config/AppKey";
import { useNavigate } from "react-router-dom";
interface AuthStore { interface AuthStore {
token: string | null | undefined; token: string | null | undefined;

View File

@ -1,15 +1,15 @@
import { create } from "zustand"; import { create } from "zustand";
interface PageTitleState { interface Page_titleState {
PageTitle: string; Page_title: string;
setPageTitle: (value: string) => void; setPage_title: (value: string) => void;
title: string | null; title: string | null;
set_title: (value: string) => void; set_title: (value: string) => void;
} }
export const usePageTitleState = create<PageTitleState>((set) => ({ export const usePage_titleState = create<Page_titleState>((set) => ({
PageTitle: "", Page_title: "",
setPageTitle: (value: string) => set(() => ({ PageTitle: value })), setPage_title: (value: string) => set(() => ({ Page_title: value })),
title: null, title: null,
set_title: (value: string) => set(() => ({ title: value })), set_title: (value: string) => set(() => ({ title: value })),
})); }));