language implementation MERMS
This commit is contained in:
+14
-12
@@ -1,5 +1,6 @@
|
||||
import Preloader from "../components/elements/Preloader"
|
||||
import { useEffect, useState } from "react"
|
||||
import { NextIntlClientProvider } from "next-intl"
|
||||
|
||||
import "/public/css/bootstrap.min.css"
|
||||
import "/public/css/flaticon.css"
|
||||
@@ -13,25 +14,26 @@ import "/public/css/responsive.css"
|
||||
import QueryClientContext from "../components/queryclientProvider/QueryClientContext"
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
const { messages, locale, ...restPageProps } = pageProps
|
||||
|
||||
const [loading, setLoading] = useState(true)
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
setLoading(false)
|
||||
}, 1000)
|
||||
|
||||
}, [])
|
||||
return (<>
|
||||
{/* <SmoothScroll /> */}
|
||||
{!loading ? (
|
||||
// <ProductHome />
|
||||
<QueryClientContext>
|
||||
<Component {...pageProps} />
|
||||
</QueryClientContext>
|
||||
) : (
|
||||
<Preloader />
|
||||
)}
|
||||
</>)
|
||||
|
||||
return (
|
||||
<NextIntlClientProvider locale={locale || "en"} messages={messages || {}}>
|
||||
{!loading ? (
|
||||
<QueryClientContext>
|
||||
<Component {...restPageProps} />
|
||||
</QueryClientContext>
|
||||
) : (
|
||||
<Preloader />
|
||||
)}
|
||||
</NextIntlClientProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default MyApp
|
||||
|
||||
Reference in New Issue
Block a user