Feature/filter badge
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import WithAuthMiddleware from "@/core/middlewares/withAuth";
|
||||
import LoadingHardPage from "@/core/components/LoadingHardPage";
|
||||
import { useAuth } from "@/lib/contexts/auth";
|
||||
import { Typography, Stack } from "@mui/material";
|
||||
|
||||
const Layout = ({ children }) => {
|
||||
const { isAuth, initAuthState, errorState } = useAuth();
|
||||
@@ -9,9 +10,16 @@ const Layout = ({ children }) => {
|
||||
if (!initAuthState && !isAuth)
|
||||
return (
|
||||
<LoadingHardPage
|
||||
authState={!!errorState}
|
||||
authState={errorState.status}
|
||||
label={
|
||||
!!errorState ? "مشکلی در احراز هویت رخ داده است . دقایقی بعد امتحان کنید!!!" : "درحال احراز هویت..."
|
||||
errorState.status ? (
|
||||
<Stack justifyContent={"center"} alignItems={"center"}>
|
||||
<Typography variant={"body1"}>{errorState.message}</Typography>
|
||||
<Typography variant={"body1"}> کد : {errorState.status}</Typography>
|
||||
</Stack>
|
||||
) : (
|
||||
<Typography variant={"body1"}>درحال احراز هویت...</Typography>
|
||||
)
|
||||
}
|
||||
loading={true}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user