diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/_app.jsx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx index e32efc19..8b13cc0b 100644 --- a/src/pages/_app.jsx +++ b/src/pages/_app.jsx @@ -4,11 +4,13 @@ import { useRouter } from 'next/router' import { AnimatePresence } from 'framer-motion' import { Toaster } from 'react-hot-toast' import { QueryClient, QueryClientProvider } from 'react-query' +import useDevice from '@/core/hooks/useDevice' const queryClient = new QueryClient() function MyApp({ Component, pageProps }) { const router = useRouter() + const { isMobile } = useDevice() return ( <> @@ -19,20 +21,14 @@ function MyApp({ Component, pageProps }) { className: 'border border-gray_r-8' }} /> - <NextProgress - color='#F01C21' - options={{ showSpinner: false }} - /> + <NextProgress color='#F01C21' options={{ showSpinner: false }} /> <QueryClientProvider client={queryClient}> <AnimatePresence - mode='wait' + mode={isMobile ? 'wait' : 'sync'} initial={false} onExitComplete={() => window.scrollTo(0, 0)} > - <Component - {...pageProps} - key={router.asPath} - /> + <Component {...pageProps} key={router.asPath} /> </AnimatePresence> </QueryClientProvider> </> |
