From adc316e70faf20ea375b3e590998a36997b6b6e2 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 26 Nov 2025 14:56:36 +0700 Subject: balikin --- src/core/components/layouts/BasicLayout.jsx | 44 +++++++++-------------------- 1 file changed, 13 insertions(+), 31 deletions(-) (limited to 'src/core/components') diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx index b13e807d..19e2c580 100644 --- a/src/core/components/layouts/BasicLayout.jsx +++ b/src/core/components/layouts/BasicLayout.jsx @@ -7,15 +7,12 @@ import { useProductContext } from '@/contexts/ProductContext'; import odooApi from '@/core/api/odooApi'; import whatsappUrl from '@/core/utils/whatsappUrl'; import Navbar from '../elements/Navbar/Navbar'; -import styles from './BasicLayout.module.css'; // Import modul CSS +import styles from './BasicLayout.module.css'; import useDevice from '@/core/hooks/useDevice'; -const AnimationLayout = dynamic(() => import('./AnimationLayout'), { - ssr: false, -}); -const BasicFooter = dynamic(() => import('../elements/Footer/BasicFooter'), { - ssr: false, -}); +// ❌ JANGAN dynamic UNTUK LAYOUT +import AnimationLayout from './AnimationLayout'; +import BasicFooter from '../elements/Footer/BasicFooter'; const BasicLayout = ({ children }) => { const [templateWA, setTemplateWA] = useState(null); @@ -27,7 +24,6 @@ const BasicLayout = ({ children }) => { const [isProductPage, setIsProductPage] = useState(false); const { isDesktop, isMobile } = useDevice(); - const router = useRouter(); const buttonRef = useRef(null); @@ -44,11 +40,10 @@ const BasicLayout = ({ children }) => { ) { setPayloadWa({ name: product?.name, - manufacture: product?.manufacture.name, + manufacture: product?.manufacture?.name, url: process.env.NEXT_PUBLIC_SELF_HOST + router.asPath, }); setTemplateWA('product'); - setUrlPath(router.asPath); } if (router.pathname.includes('/shop/product/')) { @@ -69,25 +64,17 @@ const BasicLayout = ({ children }) => { }; window.addEventListener('mouseout', handleMouseOut); - - return () => { - window.removeEventListener('mouseout', handleMouseOut); - }; + return () => window.removeEventListener('mouseout', handleMouseOut); }, []); useEffect(() => { if (highlight) { - // Set wobble animation after overlay highlight animation completes - const timer = setTimeout(() => setWobble(true), 1000); // Adjust timing if needed + const timer = setTimeout(() => setWobble(true), 1000); return () => clearTimeout(timer); } }, [highlight]); - const recordActivity = async (pathname) => { - const ONLY_ON_PATH = false; - const recordedPath = []; - if (ONLY_ON_PATH && !recordedPath.includes(pathname)) return; - + const recordActivity = async () => { const ip = await odooApi('GET', '/api/ip-address'); const data = new URLSearchParams({ page_title: document.title, @@ -117,9 +104,12 @@ const BasicLayout = ({ children }) => { onAnimationEnd={() => setHighlight(false)} /> )} + + {children} + {(!isProductPage || hasPrice) && (
{ {isDesktop && 'Whatsapp'} + { Whatsapp - Whatsapp
)}
+ ); -- cgit v1.2.3