formatting

This commit is contained in:
Amirhossein Mahmoodi
2024-08-18 11:11:58 +03:30
parent f7c93d0404
commit f2e199ee8a
40 changed files with 733 additions and 450 deletions

View File

@@ -4,7 +4,7 @@ import { Stack } from "@mui/material";
const Layout = ({ children }) => {
return (
<Stack sx={{ width: '100%', height: '100%' }}>
<Stack sx={{ width: "100%", height: "100%" }}>
<HeaderWithLogo />
<HeaderWithSidebar>{children}</HeaderWithSidebar>
</Stack>

View File

@@ -1,9 +1,7 @@
import WithAuthMiddleware from "@/core/middlewares/withAuth";
const Layout = ({ children }) => {
return (
<WithAuthMiddleware>{children}</WithAuthMiddleware>
);
return <WithAuthMiddleware>{children}</WithAuthMiddleware>;
};
export default Layout;

View File

@@ -8,7 +8,7 @@ export const metadata = {
export default function RootLayout({ children }) {
return (
<html lang="fa" dir={"rtl"}>
<body style={{ height: "100vh", width: '100vw' }}>
<body style={{ height: "100vh", width: "100vw" }}>
<AuthProvider>
<TableSettingProvider>{children}</TableSettingProvider>
</AuthProvider>

View File

@@ -8,7 +8,7 @@ import Link from "next/link";
import { useEffect, useState } from "react";
const Page = ({ searchParams }) => {
const { getUser } = useAuth()
const { getUser } = useAuth();
const { username } = searchParams;
const [login, setLogin] = useState(0);
const request = useRequest();
@@ -17,7 +17,7 @@ const Page = ({ searchParams }) => {
const login = async () => {
try {
await request(`${GET_LOGIN_ROUTE}?username=${username}`);
await getUser()
await getUser();
setLogin(1);
} catch (error) {
setLogin(2);
@@ -31,7 +31,7 @@ const Page = ({ searchParams }) => {
setLogin(0);
try {
await request(`${GET_LOGIN_ROUTE}?username=${username}`);
await getUser()
await getUser();
setLogin(1);
} catch (error) {
setLogin(2);
@@ -44,8 +44,8 @@ const Page = ({ searchParams }) => {
{login === 0
? "درحال دریافت مجوز برای ارتباط با سرور..."
: login === 1
? "ارتباط با سرور برقرار شد."
: "ارتباط با سرور برقرار نشد. مشکلی وجود دارد."}
? "ارتباط با سرور برقرار شد."
: "ارتباط با سرور برقرار نشد. مشکلی وجود دارد."}
</Typography>
<Zoom in={login === 1}>
<Button component={Link} href="/">