diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-15 15:21:58 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-15 15:21:58 +0700 |
| commit | 4a898522ad3eae38918767634d90347172f3fe9d (patch) | |
| tree | c62e3b1de8d3016133d4865a21cd134704036ef5 /src | |
| parent | 402c7aaca4d0967201ec486a0a6bc075e86e32f3 (diff) | |
fix animation mobile
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/components/layouts/AnimationLayout.jsx | 2 | ||||
| -rw-r--r-- | src/pages/_app.jsx | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/core/components/layouts/AnimationLayout.jsx b/src/core/components/layouts/AnimationLayout.jsx index 6884fb4b..7acf21dc 100644 --- a/src/core/components/layouts/AnimationLayout.jsx +++ b/src/core/components/layouts/AnimationLayout.jsx @@ -14,7 +14,7 @@ const AnimationLayout = ({ children, ...props }) => { opacity: 1, x: 0, y: 0, - transition: { duration: 0.2, ease: 'easeInOut' } + transition: { duration: 0.2, delay: 0.2, ease: 'easeInOut' } } const exitConfig = { 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> </> |
