From 4a898522ad3eae38918767634d90347172f3fe9d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 15 Mar 2023 15:21:58 +0700 Subject: fix animation mobile --- src/core/components/layouts/AnimationLayout.jsx | 2 +- src/pages/_app.jsx | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src') 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' }} /> - + window.scrollTo(0, 0)} > - + -- cgit v1.2.3