diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-17 17:07:50 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-17 17:07:50 +0700 |
| commit | f99e0aba70efad0deb907d8e27f09fc9f527c8a4 (patch) | |
| tree | f0ac96e4e736a1d385e32553f0e641ee27e11fd3 /src2/pages/_app.js | |
| parent | 90e1edab9b6a8ccc09a49fed3addbec2cbc4e4c3 (diff) | |
Refactor
Diffstat (limited to 'src2/pages/_app.js')
| -rw-r--r-- | src2/pages/_app.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src2/pages/_app.js b/src2/pages/_app.js new file mode 100644 index 00000000..6a40f4e6 --- /dev/null +++ b/src2/pages/_app.js @@ -0,0 +1,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 |
