diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-06 16:36:57 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-06 16:36:57 +0700 |
| commit | 337e0f377624e5a0b46aa0ed3c3c16ba4e289965 (patch) | |
| tree | 61f72ab1ff1df7411c71e9ec3db1e5a12e7a2c83 /src | |
| parent | 640c86b03f866f8fd3e2254d4611a3faf53386b4 (diff) | |
<iman> update mobile view
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/components/layouts/BasicLayout.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx index d6b96f36..1b62bf05 100644 --- a/src/core/components/layouts/BasicLayout.jsx +++ b/src/core/components/layouts/BasicLayout.jsx @@ -24,6 +24,7 @@ const BasicLayout = ({ children }) => { const [highlight, setHighlight] = useState(false); const [buttonPosition, setButtonPosition] = useState(null); const [wobble, setWobble] = useState(false); + const [isProductPage, setIsProductPage] = useState(false); const { isDesktop, isMobile } = useDevice(); @@ -46,6 +47,9 @@ const BasicLayout = ({ children }) => { setUrlPath(router.asPath); } + if (router.pathname.includes('/shop/product/')) { + setIsProductPage(true); + } }, [product, router]); useEffect(() => { @@ -111,7 +115,11 @@ const BasicLayout = ({ children }) => { <Navbar /> <AnimationLayout> {children} - <div className='fixed bottom-16 right-4 sm:bottom-14 sm:right-10 z-50'> + <div + className={`fixed ${ + isMobile && isProductPage ? 'bottom-40' : 'bottom-16' + } right-4 sm:bottom-14 sm:right-10 z-50`} + > <div className='flex flex-row items-center'> <a href={whatsappUrl(templateWA, payloadWA, urlPath)} |
