From 191f6592375ebac9d1530b67e7100a13a6155239 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 28 Feb 2024 11:23:54 +0700
Subject: Enable record activity log on all page

---
 src/core/components/layouts/BasicLayout.jsx | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

(limited to 'src/core/components/layouts/BasicLayout.jsx')

diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx
index fa41a8ed..13f4af76 100644
--- a/src/core/components/layouts/BasicLayout.jsx
+++ b/src/core/components/layouts/BasicLayout.jsx
@@ -42,13 +42,10 @@ const BasicLayout = ({ children }) => {
     }
   }, [product, router]);
 
-  const recordActivity = useCallback(async () => {
-    const recordedPath = [
-      '/shop/product/[slug]',
-      '/shop/product/variant/[slug]',
-    ];
-
-    if (!recordedPath.includes(router.pathname)) return;
+  const recordActivity = async (pathname) => {
+    const ONLY_ON_PATH = false;
+    const recordedPath = [];
+    if (ONLY_ON_PATH && !recordedPath.includes(pathname)) return;
 
     const ip = await odooApi('GET', '/api/ip-address');
     const data = new URLSearchParams({
@@ -58,11 +55,11 @@ const BasicLayout = ({ children }) => {
     });
 
     fetch(`/api/user-activity?${data.toString()}`);
-  }, [router.pathname]);
+  };
 
   useEffect(() => {
-    recordActivity();
-  }, [recordActivity]);
+    recordActivity(router.pathname);
+  }, [router.pathname]);
 
   return (
     <>
-- 
cgit v1.2.3


From 58267593b6214ecc37489802729a5702116794af Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 29 Feb 2024 15:31:16 +0700
Subject: Update flashsale section

---
 src/core/components/layouts/BasicLayout.jsx | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'src/core/components/layouts/BasicLayout.jsx')

diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx
index 13f4af76..a4f3a856 100644
--- a/src/core/components/layouts/BasicLayout.jsx
+++ b/src/core/components/layouts/BasicLayout.jsx
@@ -1,16 +1,13 @@
 import dynamic from 'next/dynamic';
 import Image from 'next/image';
-import { useCallback, useEffect, useState } from 'react';
+import { useRouter } from 'next/router';
+import { useEffect, useState } from 'react';
 
 import { useProductContext } from '@/contexts/ProductContext';
 import odooApi from '@/core/api/odooApi';
 import whatsappUrl from '@/core/utils/whatsappUrl';
-import { useRouter } from 'next/router';
+import Navbar from '../elements/Navbar/Navbar';
 
-const Navbar = dynamic(() => import('../elements/Navbar/Navbar'), {
-  ssr: false,
-  loading: () => <div className='h-[156px]' />,
-});
 const AnimationLayout = dynamic(() => import('./AnimationLayout'), {
   ssr: false,
 });
-- 
cgit v1.2.3

