fixed ToastContainer

This commit is contained in:
Amirhossein Mahmoodi
2023-08-01 09:22:22 +03:30
parent 131f80b0b5
commit 94bfa0c83f
5 changed files with 5 additions and 16 deletions

View File

@@ -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}
</>
);