formate
This commit is contained in:
parent
0f471f4483
commit
1055417dc0
8498
pnpm-lock.yaml
8498
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -25,7 +25,10 @@ export const MenuItem = ({ item, location, index }: any) => {
|
||||||
<i>{item.icon}</i>
|
<i>{item.icon}</i>
|
||||||
<Link to={item.path || "/"}>{t(item.text)}</Link>
|
<Link to={item.path || "/"}>{t(item.text)}</Link>
|
||||||
{item?.children && (
|
{item?.children && (
|
||||||
<DropdownToggle isOpen={isDropdownOpen} onClick={() => handleDropdown(index)} />
|
<DropdownToggle
|
||||||
|
isOpen={isDropdownOpen}
|
||||||
|
onClick={() => handleDropdown(index)}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
import { getLocalStorage } from '../../../utils/LocalStorage';
|
import { getLocalStorage } from "../../../utils/LocalStorage";
|
||||||
import { USER_KEY } from '../../../config/AppKey';
|
import { USER_KEY } from "../../../config/AppKey";
|
||||||
import { translateOptions } from '../../../utils/translatedOptions';
|
import { translateOptions } from "../../../utils/translatedOptions";
|
||||||
import { search_array } from '../../../Routes';
|
import { search_array } from "../../../Routes";
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from "react-i18next";
|
||||||
import SearchFieldWithSelect from '../../DataTable/SearchFieldWithSelect';
|
import SearchFieldWithSelect from "../../DataTable/SearchFieldWithSelect";
|
||||||
import { Tooltip } from 'antd';
|
import { Tooltip } from "antd";
|
||||||
import useModalHandler from '../../../utils/useModalHandler';
|
import useModalHandler from "../../../utils/useModalHandler";
|
||||||
import { ModalEnum } from '../../../enums/Model';
|
import { ModalEnum } from "../../../enums/Model";
|
||||||
import Image from '../../Ui/Image';
|
import Image from "../../Ui/Image";
|
||||||
const NavBarRightSide = () => {
|
const NavBarRightSide = () => {
|
||||||
const userData = getLocalStorage(USER_KEY);
|
const userData = getLocalStorage(USER_KEY);
|
||||||
const [t] = useTranslation()
|
const [t] = useTranslation();
|
||||||
const translateArray = translateOptions(search_array, t);
|
const translateArray = translateOptions(search_array, t);
|
||||||
|
|
||||||
const { handel_open_model } = useModalHandler();
|
const { handel_open_model } = useModalHandler();
|
||||||
|
|
@ -32,7 +32,11 @@ const NavBarRightSide = () => {
|
||||||
</div>
|
</div>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement="top"
|
placement="top"
|
||||||
title={<div onClick={handleEdit}>{t("header.change_your_current_password")}</div>}
|
title={
|
||||||
|
<div onClick={handleEdit}>
|
||||||
|
{t("header.change_your_current_password")}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
color="#E0E0E0"
|
color="#E0E0E0"
|
||||||
>
|
>
|
||||||
<div className="gear">
|
<div className="gear">
|
||||||
|
|
@ -48,7 +52,7 @@ const NavBarRightSide = () => {
|
||||||
<Image src="/Layout/DefaultStudentImage.png" alt="Profile" />
|
<Image src="/Layout/DefaultStudentImage.png" alt="Profile" />
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default NavBarRightSide
|
export default NavBarRightSide;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,12 @@ const SubMenu: React.FC<SubMenuProps> = ({ items, location }) => {
|
||||||
return (
|
return (
|
||||||
<div className="sub-menu">
|
<div className="sub-menu">
|
||||||
{items.map((childItem, index) => (
|
{items.map((childItem, index) => (
|
||||||
<MenuItem key={index} item={childItem} location={location} index={index} />
|
<MenuItem
|
||||||
|
key={index}
|
||||||
|
item={childItem}
|
||||||
|
location={location}
|
||||||
|
index={index}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,6 @@ export const RenderRouteElement = (route: any) => (
|
||||||
</Layout>
|
</Layout>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{route.header ? (
|
{route.header ? <Layout>{route.element}</Layout> : route.element || <></>}
|
||||||
<Layout>{route.element}</Layout>
|
|
||||||
) : (
|
|
||||||
route.element || <></>
|
|
||||||
)}
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,4 @@ export const renderRoutesRecursively = (routes: TMenuItem[]) =>
|
||||||
{route.children && renderRoutesRecursively(route.children)}
|
{route.children && renderRoutesRecursively(route.children)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,7 @@ const Layout = ({
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<ProtectedRouteProvider className="Layout">
|
<ProtectedRouteProvider className="Layout">
|
||||||
<main className={`${className} Layout_Body`}>
|
<main className={`${className} Layout_Body`}>
|
||||||
<NavBar />
|
<NavBar />
|
||||||
|
|
@ -20,7 +18,6 @@ const Layout = ({
|
||||||
</main>
|
</main>
|
||||||
<SideBar />
|
<SideBar />
|
||||||
</ProtectedRouteProvider>
|
</ProtectedRouteProvider>
|
||||||
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ const NavBar = () => {
|
||||||
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;
|
||||||
|
|
@ -25,7 +24,6 @@ const NavBar = () => {
|
||||||
navigate(deletePathSegments(location.pathname, PrevPath));
|
navigate(deletePathSegments(location.pathname, PrevPath));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="NavBar">
|
<div className="NavBar">
|
||||||
<span className="navbar_link" onClick={handelNavigate}>
|
<span className="navbar_link" onClick={handelNavigate}>
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ 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";
|
import { MenuItem } from "../../Components/Layout/SideBar/MenuItem";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const SideBar = () => {
|
const SideBar = () => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,9 @@ function ProviderContainer({ children }: ChildrenType) {
|
||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
<QueryProvider>
|
<QueryProvider>
|
||||||
<ToastProvider>
|
<ToastProvider>
|
||||||
<AntdProvider>
|
<AntdProvider>{children}</AntdProvider>
|
||||||
|
|
||||||
{children}
|
|
||||||
</AntdProvider>
|
|
||||||
|
|
||||||
</ToastProvider>
|
</ToastProvider>
|
||||||
</QueryProvider>
|
</QueryProvider>
|
||||||
|
|
||||||
</I18nProvider>
|
</I18nProvider>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.ModelBodyForm {
|
.ModelBodyForm {
|
||||||
padding: 2vw;
|
padding: 2vw;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
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";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
export enum LocalStorageEnum {
|
export enum LocalStorageEnum {
|
||||||
PROJECT_NAME = 'SCHOOL_DASHBOARD_EXERCISE',
|
PROJECT_NAME = "SCHOOL_DASHBOARD_EXERCISE",
|
||||||
LANGUAGE_KEY = LocalStorageEnum.PROJECT_NAME + '_LANGUAGE',
|
LANGUAGE_KEY = LocalStorageEnum.PROJECT_NAME + "_LANGUAGE",
|
||||||
TOKEN_KEY = LocalStorageEnum.PROJECT_NAME + '_TOKEN_KEY',
|
TOKEN_KEY = LocalStorageEnum.PROJECT_NAME + "_TOKEN_KEY",
|
||||||
USER_KEY = LocalStorageEnum.PROJECT_NAME + '_USER_KEY',
|
USER_KEY = LocalStorageEnum.PROJECT_NAME + "_USER_KEY",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { ConfigProvider } from 'antd';
|
import { ConfigProvider } from "antd";
|
||||||
|
|
||||||
function AntdProvider({ children }: { children: React.ReactNode }) {
|
function AntdProvider({ children }: { children: React.ReactNode }) {
|
||||||
const primaryColor = "#3182ce";
|
const primaryColor = "#3182ce";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from "react";
|
||||||
import { I18nextProvider } from 'react-i18next';
|
import { I18nextProvider } from "react-i18next";
|
||||||
import i18n from './i18nConfig'; // Import the configured i18n instance
|
import i18n from "./i18nConfig"; // Import the configured i18n instance
|
||||||
|
|
||||||
interface I18nProviderProps {
|
interface I18nProviderProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ interface ProtectedRouteProviderProps extends React.HTMLProps<HTMLDivElement> {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProtectedRouteProvider({ children, ...props }: ProtectedRouteProviderProps) {
|
function ProtectedRouteProvider({
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
}: ProtectedRouteProviderProps) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { isAuthenticated } = useAuthState();
|
const { isAuthenticated } = useAuthState();
|
||||||
|
|
||||||
|
|
@ -16,11 +19,7 @@ function ProtectedRouteProvider({ children, ...props }: ProtectedRouteProviderPr
|
||||||
}
|
}
|
||||||
}, [isAuthenticated, navigate]);
|
}, [isAuthenticated, navigate]);
|
||||||
|
|
||||||
return (
|
return <div {...props}>{children}</div>;
|
||||||
<div {...props}>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ProtectedRouteProvider;
|
export default ProtectedRouteProvider;
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import i18n from 'i18next';
|
import i18n from "i18next";
|
||||||
import { initReactI18next } from 'react-i18next';
|
import { initReactI18next } from "react-i18next";
|
||||||
import translationAR from '../translate/ar.json';
|
import translationAR from "../translate/ar.json";
|
||||||
|
|
||||||
const resources = {
|
const resources = {
|
||||||
ar: {
|
ar: {
|
||||||
|
|
@ -10,7 +10,7 @@ const resources = {
|
||||||
|
|
||||||
i18n.use(initReactI18next).init({
|
i18n.use(initReactI18next).init({
|
||||||
resources,
|
resources,
|
||||||
lng: 'ar', // Set the default language
|
lng: "ar", // Set the default language
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false,
|
escapeValue: false,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user