summaryrefslogtreecommitdiff
path: root/src/core/components/elements
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-03-31 11:17:55 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-03-31 11:17:55 +0700
commit092dc7fc49246580023a8b97101d51845c81bf04 (patch)
tree089121b3c6cf46429411ae6edc6c4babfebe0e0d /src/core/components/elements
parentf23d32a4b8402904e8daa7b906c03a64104ed253 (diff)
iframe content
Diffstat (limited to 'src/core/components/elements')
-rw-r--r--src/core/components/elements/Link/Link.jsx10
-rw-r--r--src/core/components/elements/Popup/BottomPopup.jsx6
2 files changed, 12 insertions, 4 deletions
diff --git a/src/core/components/elements/Link/Link.jsx b/src/core/components/elements/Link/Link.jsx
index 75fc6ca8..557abbc4 100644
--- a/src/core/components/elements/Link/Link.jsx
+++ b/src/core/components/elements/Link/Link.jsx
@@ -1,10 +1,18 @@
import NextLink from 'next/link'
+import { useRouter } from 'next/router'
+import { useEffect } from 'react'
const Link = ({ children, ...props }) => {
+ const router = useRouter()
+
+ useEffect(() => {
+ router.events.on('routeChangeStart', () => window.scrollTo({ top: 0, behavior: 'smooth' }))
+ }, [router])
+
return (
<NextLink
{...props}
- onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
+ // onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
scroll={false}
className={`block font-medium text-red_r-11 ${props?.className || ''}`}
>
diff --git a/src/core/components/elements/Popup/BottomPopup.jsx b/src/core/components/elements/Popup/BottomPopup.jsx
index 1fc77932..5e9f68c7 100644
--- a/src/core/components/elements/Popup/BottomPopup.jsx
+++ b/src/core/components/elements/Popup/BottomPopup.jsx
@@ -49,9 +49,9 @@ const BottomPopup = ({ children, active = false, title, close }) => {
<DesktopView>
<motion.div
- initial={{ bottom: '40%', opacity: 0 }}
- animate={{ bottom: '35%', opacity: 1 }}
- exit={{ bottom: '30%', opacity: 0 }}
+ initial={{ bottom: '55%', opacity: 0 }}
+ animate={{ bottom: '50%', opacity: 1 }}
+ exit={{ bottom: '45%', opacity: 0 }}
transition={transition}
className='fixed left-1/2 -translate-x-1/2 w-2/5 border border-gray_r-6 rounded-xl z-[60] p-4 pt-0 bg-white'
>