summaryrefslogtreecommitdiff
path: root/src2/pages/_app.js
blob: 6a40f4e66b7de07a4ecaf368e66b810ee25b4d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import '../styles/globals.css';
import NextProgress from 'next-progress';
import { useRouter } from 'next/router';
import { AnimatePresence } from 'framer-motion';
import { Toaster } from "react-hot-toast";

function MyApp({ Component, pageProps }) {
  const router = useRouter();

  return (
    <>
      <Toaster
        position="top-center"
        toastOptions={{
          duration: 3000,
          className: 'border border-gray_r-8'
        }}
      />
      <NextProgress color="#F01C21" options={{ showSpinner: false }} />
      <AnimatePresence 
        mode='wait' 
        initial={false} 
        onExitComplete={() => window.scrollTo(0, 0)}
      >
        <Component {...pageProps} key={router.asPath} />
      </AnimatePresence>
    </>
  )
}

export default MyApp