Feature/fixe bugs

This commit is contained in:
2024-12-01 13:08:16 +00:00
committed by AmirHossein Mahmoodi
parent 5bc366a30e
commit c40fccac6b
18 changed files with 767 additions and 74 deletions

View File

@@ -1,6 +1,22 @@
"use client";
import WithAuthMiddleware from "@/core/middlewares/withAuth";
import LoadingHardPage from "@/core/components/LoadingHardPage";
import { useAuth } from "@/lib/contexts/auth";
const Layout = ({ children }) => {
const { isAuth, initAuthState, errorState } = useAuth();
if (!initAuthState && !isAuth)
return (
<LoadingHardPage
authState={!!errorState}
label={
!!errorState ? "مشکلی در احراز هویت رخ داده است . دقایقی بعد امتحان کنید!!!" : "درحال احراز هویت..."
}
loading={true}
/>
);
return <WithAuthMiddleware>{children}</WithAuthMiddleware>;
};

View File

@@ -1,5 +1,6 @@
import { AuthProvider } from "@/lib/contexts/auth";
import { TableSettingProvider } from "@/lib/contexts/tableSetting";
import favicon from "@/assets/images/favicon.svg";
export const metadata = {
title: "سامانه جامع راهداری",
@@ -8,6 +9,9 @@ export const metadata = {
export default function RootLayout({ children }) {
return (
<html lang="fa" dir={"rtl"}>
<head>
<link rel="icon" href={favicon.src} type="image/svg" sizes="any" />
</head>
<body style={{ height: "100vh", width: "100vw" }}>
<AuthProvider>
<TableSettingProvider>{children}</TableSettingProvider>

16
src/app/not-found.js Normal file
View File

@@ -0,0 +1,16 @@
"use client";
import { Box, Stack, Typography } from "@mui/material";
import SvgNotFound from "@/core/components/svgs/SvgNotFound";
export default function NotFound() {
return (
<Stack sx={{ height: "100%" }} justifyContent={"center"} alignItems={"center"} spacing={2}>
<Box>
<SvgNotFound width={200} height={200} />
</Box>
<Typography variant={"body1"} sx={{ color: "primary.main" }}>
صفحه موردنظر یافت نشد ...
</Typography>
</Stack>
);
}