From 81787db3eddc401e40304286e4d01cf60a7ea3d0 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 27 Sep 2023 10:23:50 +0700
Subject: Update globals css and app js

---
 src/pages/_app.jsx | 33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

(limited to 'src/pages/_app.jsx')

diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index 0062f7fc..d5b59486 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -1,15 +1,16 @@
 import '../styles/globals.css'
 import 'react-loading-skeleton/dist/skeleton.css'
+import '@fontsource/inter'
+
 import NextProgress from 'next-progress'
 import { useRouter, Router } from 'next/router'
 import { AnimatePresence, motion } from 'framer-motion'
 import { Toaster } from 'react-hot-toast'
 import { QueryClient, QueryClientProvider } from 'react-query'
 import useDevice from '@/core/hooks/useDevice'
-import { createContext, useContext, useEffect, useState } from 'react'
+import { createContext, useEffect, useState } from 'react'
 import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
 import { SessionProvider } from 'next-auth/react'
-import { getAuth } from '@/core/utils/auth'
 import { ProductProvider } from '@/contexts/ProductContext'
 import { ProductCartProvider } from '@/contexts/ProductCartContext'
 
@@ -25,12 +26,6 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }) {
   const { isMobile } = useDevice()
 
   const [animateLoader, setAnimateLoader] = useState(false)
-  const [authenticated, setAuthenticated] = useState(null)
-  const auth = getAuth()
-
-  // useEffect(() => {
-  //   setAuthenticated(auth)
-  // }, [auth])
 
   useEffect(() => {
     const handleRouteChangeStart = () => setAnimateLoader(true)
@@ -63,14 +58,13 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }) {
   }, [isMobile])
 
   return (
-    // <AuthContext.Provider value={{authenticated, setAuthenticated}}>
     <SessionProvider session={session}>
       <AnimatePresence>
         {animateLoader && (
           <motion.div
-            initial={{ opacity: 0 }}
+            initial={{ opacity: 0.4 }}
             animate={{ opacity: 1 }}
-            exit={{ opacity: 0 }}
+            exit={{ opacity: 0.4 }}
             transition={{
               duration: 0.1
             }}
@@ -90,20 +84,13 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }) {
       />
       <NextProgress color='#F01C21' options={{ showSpinner: false }} />
       <QueryClientProvider client={queryClient}>
-        <AnimatePresence
-          mode='popLayout'
-          initial={false}
-          onExitComplete={() => window.scrollTo(0, 0)}
-        >
-          <ProductProvider>
-            <ProductCartProvider>
-              {!animateLoader && <Component {...pageProps} key={router.asPath} />}
-            </ProductCartProvider>
-          </ProductProvider>
-        </AnimatePresence>
+        <ProductProvider>
+          <ProductCartProvider>
+            <Component {...pageProps} key={router.asPath} />
+          </ProductCartProvider>
+        </ProductProvider>
       </QueryClientProvider>
     </SessionProvider>
-    // </AuthContext.Provider>
   )
 }
 
-- 
cgit v1.2.3

