merge and resolve conflict

This commit is contained in:
2024-07-11 10:47:01 +03:30
42 changed files with 1243 additions and 338 deletions

View File

@@ -0,0 +1,10 @@
import InquiryPrivacyFencingPage from "@/components/dashboard/inquiryPrivacyFencing";
const Page = () => {
return (
<InquiryPrivacyFencingPage />
);
};
export default Page;

View File

@@ -1,5 +1,9 @@
const Page = () => {
return <div>dashboard</div>;
return (
<>
</>
);
};
export default Page;

View File

@@ -1,17 +0,0 @@
import { Box, Stack } from "@mui/material";
import HeaderWithLogo from "@/components/layouts/dashboard/headerWithLogo";
import HeaderWithSidebar from "@/components/layouts/dashboard/headerWithSidebar";
import "react-toastify/dist/ReactToastify.css";
const Template = ({ children }) => {
return (
<Stack>
<HeaderWithLogo />
<Box>
<HeaderWithSidebar>{children}</HeaderWithSidebar>
</Box>
</Stack>
);
};
export default Template;

View File

@@ -0,0 +1,12 @@
import WithAuthMiddleware from "@/core/middlewares/withAuth";
import { AuthProvider } from "@/lib/contexts/auth";
const Layout = ({ children }) => {
return (
<AuthProvider>
<WithAuthMiddleware>{children}</WithAuthMiddleware>
</AuthProvider>
);
};
export default Layout;

3
src/app/default.js Normal file
View File

@@ -0,0 +1,3 @@
export default function Default() {
return null;
}

57
src/app/lfwd/page.js Normal file
View File

@@ -0,0 +1,57 @@
"use client";
import { GET_LOGIN_ROUTE } from "@/core/utils/routes";
import useRequest from "@/lib/hooks/useRequest";
import { Button, Stack, Typography, Zoom } from "@mui/material";
import Link from "next/link";
import { useEffect, useState } from "react";
const Page = ({ searchParams }) => {
const { username } = searchParams;
const [login, setLogin] = useState(0);
const request = useRequest();
useEffect(() => {
const login = async () => {
try {
await request(`${GET_LOGIN_ROUTE}?username=${username}`);
setLogin(1);
} catch (error) {
setLogin(2);
}
};
login();
}, []);
const retry = async () => {
setLogin(0);
try {
await request(`${GET_LOGIN_ROUTE}?username=${username}`);
setLogin(1);
} catch (error) {
setLogin(2);
}
};
return (
<Stack alignItems={"center"} justifyContent={"center"} sx={{ height: "100%" }} spacing={2}>
<Typography variant="h5">
{login === 0
? "درحال دریافت مجوز برای ارتباط با سرور..."
: login === 1
? "ارتباط با سرور برقرار شد."
: "ارتباط با سرور برقرار نشد. مشکلی وجود دارد."}
</Typography>
<Zoom in={login === 1}>
<Button component={Link} href="/">
ورود به سامانه
</Button>
</Zoom>
<Zoom in={login === 2}>
<Button onClick={retry}>تلاش مجدد</Button>
</Zoom>
</Stack>
);
};
export default Page;

View File

@@ -1,8 +1,8 @@
"use client";
import HomeComponent from "@/components/home";
import { redirect } from "next/navigation";
function Page() {
return <HomeComponent />;
redirect("/dashboard", "replace");
return null;
}
export default Page;

View File

@@ -2,7 +2,6 @@ import cacheProviderRtl from "@/core/utils/cacheRtl";
import { CssBaseline, ThemeProvider } from "@mui/material";
import theme from "@/core/utils/theme";
import { AppRouterCacheProvider } from "@mui/material-nextjs/v14-appRouter";
import "react-toastify/dist/ReactToastify.css";
import "^/global.scss";
import { ToastContainer } from "react-toastify";
@@ -12,7 +11,8 @@ const Template = ({ children }) => {
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
<ToastContainer rtl containerId="datatable" closeButton={false} />
<ToastContainer rtl containerId="filtering" closeButton={false} />
<ToastContainer rtl containerId="request_data" />
</ThemeProvider>
</AppRouterCacheProvider>
);