fixed ToastContainer
This commit is contained in:
@@ -5,11 +5,15 @@ import useUser from "@/lib/app/hooks/useUser";
|
||||
import Head from "next/head";
|
||||
import NextNProgress from "nextjs-progressbar";
|
||||
import {useEffect} from "react";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
|
||||
function AppLayout({children, isBot}) {
|
||||
const {languageIsReady} = useLanguage();
|
||||
const {setLoadingPage} = useLoading();
|
||||
const {userChangedLanguage, token, isAuth} = useUser();
|
||||
const {directionApp} = useDirection();
|
||||
|
||||
useEffect(() => {
|
||||
if (languageIsReady) {
|
||||
if (token) {
|
||||
@@ -91,6 +95,7 @@ function AppLayout({children, isBot}) {
|
||||
color={theme.palette.secondary.dark}
|
||||
options={{showSpinner: false}}
|
||||
/>
|
||||
{directionApp === "rtl" ? <ToastContainer rtl/> : <ToastContainer ltr/>}
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -2,15 +2,11 @@ import LoginComponent from "@/components/login";
|
||||
import WithoutAuthMiddleware from "@/middlewares/WithoutAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
|
||||
export default function Login() {
|
||||
const {directionApp} = useDirection();
|
||||
return (
|
||||
<WithoutAuthMiddleware>
|
||||
<LoginComponent/>
|
||||
{directionApp === "rtl" ? <ToastContainer rtl/> : <ToastContainer ltr/>}
|
||||
</WithoutAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,11 @@ import RegisterComponent from "@/components/register";
|
||||
import WithoutAuthMiddleware from "@/middlewares/WithoutAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
|
||||
export default function Register() {
|
||||
const {directionApp} = useDirection();
|
||||
return (
|
||||
<WithoutAuthMiddleware>
|
||||
<RegisterComponent/>
|
||||
{directionApp === "rtl" ? <ToastContainer rtl/> : <ToastContainer ltr/>}
|
||||
</WithoutAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,11 @@ import NavyComponent from "@/components/register/navy";
|
||||
import WithoutAuthMiddleware from "@/middlewares/WithoutAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
|
||||
export default function Register() {
|
||||
const {directionApp} = useDirection();
|
||||
return (
|
||||
<WithoutAuthMiddleware>
|
||||
<NavyComponent/>
|
||||
{directionApp === "rtl" ? <ToastContainer rtl/> : <ToastContainer ltr/>}
|
||||
</WithoutAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,11 @@ import WelfareServicesComponent from "@/components/register/welfare-services";
|
||||
import WithoutAuthMiddleware from "@/middlewares/WithoutAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
|
||||
export default function Register() {
|
||||
const {directionApp} = useDirection();
|
||||
return (
|
||||
<WithoutAuthMiddleware>
|
||||
<WelfareServicesComponent/>
|
||||
{directionApp === "rtl" ? <ToastContainer rtl/> : <ToastContainer ltr/>}
|
||||
</WithoutAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user