From c88d98f06a6301bad6dd6d2e58b4908d8562638c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 7 Jun 2024 17:08:09 +0700 Subject: add promotion program --- src/pages/index.jsx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index c097530c..ddc41cbe 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -41,6 +41,11 @@ const FlashSale = dynamic( loading: () => , } ); + +const ProgramPromotion = dynamic(() => + import('@/lib/home/components/PromotionProgram') +); + const BannerSection = dynamic(() => import('@/lib/home/components/BannerSection') ); @@ -103,6 +108,7 @@ export default function Home() { + @@ -126,6 +132,7 @@ export default function Home() { + -- cgit v1.2.3 From ced37d32aa345fc288483716771422e7b7c0913a Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 19 Jun 2024 17:10:24 +0700 Subject: update tampilan promotion program --- src/pages/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index ddc41cbe..80e9ef0e 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -102,13 +102,13 @@ export default function Home() { -
+
- + -- cgit v1.2.3 From ca0faeb73b521a40a2e96b2e7b724b839db6aa57 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 28 Jun 2024 16:47:06 +0700 Subject: update mobile view --- src/pages/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 80e9ef0e..3da381b6 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -130,9 +130,11 @@ export default function Home() {
+ + + - -- cgit v1.2.3 From 556cbc1e5ea1c1ef0170c9a1b8f470a3d92d888e Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 2 Jul 2024 10:40:06 +0700 Subject: IS SO APPROVAL --- src/pages/index.jsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index c097530c..914fb266 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -11,6 +11,8 @@ import { FlashSaleSkeleton } from '@/lib/flashSale/skeleton/FlashSaleSkeleton'; import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBrandSkeleton'; import PromotinProgram from '@/lib/promotinProgram/components/HomePage'; import PagePopupIformation from '~/modules/popup-information'; +import useProductDetail from '~/modules/product-detail/stores/useProductDetail'; +import { getAuth } from '~/libs/auth'; const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout') @@ -56,6 +58,8 @@ export default function Home() { const bannerRef = useRef(null); const wrapperRef = useRef(null); + const auth = getAuth(); + const handleOnLoad = () => { wrapperRef.current.style.height = bannerRef.current?.querySelector(':first-child')?.clientHeight + 'px'; @@ -102,7 +106,7 @@ export default function Home() {
- + {!auth?.feature?.soApproval && } @@ -124,9 +128,11 @@ export default function Home() {
- - - + {!auth?.feature?.soApproval && ( + + + + )} -- cgit v1.2.3 From 617f920b5d60e989c08f8afd0e969d0d285b5a36 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 7 Aug 2024 09:36:36 +0700 Subject: add skeleton to banner promo homepage --- src/pages/index.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 8af963fb..cad5d33b 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -9,6 +9,7 @@ import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; import { FlashSaleSkeleton } from '@/lib/flashSale/skeleton/FlashSaleSkeleton'; import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBrandSkeleton'; +import BannerPromoSkeleton from '@/lib/home/components/Skeleton/BannerPromoSkeleton'; import PromotinProgram from '@/lib/promotinProgram/components/HomePage'; import PagePopupIformation from '~/modules/popup-information'; import useProductDetail from '~/modules/product-detail/stores/useProductDetail'; @@ -45,7 +46,10 @@ const FlashSale = dynamic( ); const ProgramPromotion = dynamic(() => - import('@/lib/home/components/PromotionProgram') + import('@/lib/home/components/PromotionProgram'), +{ + loading: () => , +} ); const BannerSection = dynamic(() => @@ -113,7 +117,12 @@ export default function Home() { {!auth?.feature?.soApproval && ( <> - + + + + + + )} -- cgit v1.2.3 From d89421e6270ea17ecfee8fde95121a8e2443feac Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 9 Aug 2024 17:07:42 +0700 Subject: merge developmet to avoid conflict --- src/pages/index.jsx | 55 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 13 deletions(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index cad5d33b..cfda03ea 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -1,6 +1,5 @@ import dynamic from 'next/dynamic'; -import { useRef } from 'react'; - +import { useEffect, useRef, useState } from 'react'; import { HeroBannerSkeleton } from '@/components/skeleton/BannerSkeleton'; import { PopularProductSkeleton } from '@/components/skeleton/PopularProductSkeleton'; import Seo from '@/core/components/Seo'; @@ -12,8 +11,10 @@ import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBran import BannerPromoSkeleton from '@/lib/home/components/Skeleton/BannerPromoSkeleton'; import PromotinProgram from '@/lib/promotinProgram/components/HomePage'; import PagePopupIformation from '~/modules/popup-information'; -import useProductDetail from '~/modules/product-detail/stores/useProductDetail'; +import CategoryPilihan from '../lib/home/components/CategoryPilihan'; +import odooApi from '@/core/api/odooApi'; import { getAuth } from '~/libs/auth'; +// import { getAuth } from '~/libs/auth'; const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout') @@ -45,12 +46,9 @@ const FlashSale = dynamic( } ); -const ProgramPromotion = dynamic(() => - import('@/lib/home/components/PromotionProgram'), -{ - loading: () => , -} -); +// const ProgramPromotion = dynamic(() => +// import('@/lib/home/components/PromotionProgram') +// ); const BannerSection = dynamic(() => import('@/lib/home/components/BannerSection') @@ -58,12 +56,23 @@ const BannerSection = dynamic(() => const CategoryHomeId = dynamic(() => import('@/lib/home/components/CategoryHomeId') ); + +const CategoryDynamic = dynamic(() => + import('@/lib/home/components/CategoryDynamic') +); + +const CategoryDynamicMobile = dynamic(() => +import('@/lib/home/components/CategoryDynamicMobile') +); + const CustomerReviews = dynamic(() => import('@/lib/review/components/CustomerReviews') ); const ServiceList = dynamic(() => import('@/lib/home/components/ServiceList')); -export default function Home() { + + +export default function Home({categoryId}) { const bannerRef = useRef(null); const wrapperRef = useRef(null); @@ -74,6 +83,18 @@ export default function Home() { bannerRef.current?.querySelector(':first-child')?.clientHeight + 'px'; }; + useEffect(() => { + const loadCategories = async () => { + const getCategories = await odooApi('GET', '/api/v1/category/child?partner_id='+{categoryId}) + if(getCategories){ + setDataCategories(getCategories) + } + } + loadCategories() + }, []) + + const [dataCategories, setDataCategories] = useState([]) + return ( +
@@ -126,10 +148,13 @@ export default function Home() { )} + +
+
@@ -137,7 +162,7 @@ export default function Home() { -
+
@@ -149,7 +174,7 @@ export default function Home() { {!auth?.feature?.soApproval && ( <> - + {/* */} @@ -159,6 +184,10 @@ export default function Home() { + + + + @@ -173,4 +202,4 @@ export default function Home() { ); -} +} \ No newline at end of file -- cgit v1.2.3 From ebe159fc10e4c774ae1bd6aafa772f39618ca372 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 9 Aug 2024 17:13:04 +0700 Subject: back to original --- src/pages/index.jsx | 53 ++++++++++++----------------------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) (limited to 'src/pages/index.jsx') diff --git a/src/pages/index.jsx b/src/pages/index.jsx index cfda03ea..4493fe31 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -1,5 +1,6 @@ import dynamic from 'next/dynamic'; -import { useEffect, useRef, useState } from 'react'; +import { useRef } from 'react'; + import { HeroBannerSkeleton } from '@/components/skeleton/BannerSkeleton'; import { PopularProductSkeleton } from '@/components/skeleton/PopularProductSkeleton'; import Seo from '@/core/components/Seo'; @@ -11,10 +12,8 @@ import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBran import BannerPromoSkeleton from '@/lib/home/components/Skeleton/BannerPromoSkeleton'; import PromotinProgram from '@/lib/promotinProgram/components/HomePage'; import PagePopupIformation from '~/modules/popup-information'; -import CategoryPilihan from '../lib/home/components/CategoryPilihan'; -import odooApi from '@/core/api/odooApi'; +import useProductDetail from '~/modules/product-detail/stores/useProductDetail'; import { getAuth } from '~/libs/auth'; -// import { getAuth } from '~/libs/auth'; const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout') @@ -46,9 +45,12 @@ const FlashSale = dynamic( } ); -// const ProgramPromotion = dynamic(() => -// import('@/lib/home/components/PromotionProgram') -// ); +const ProgramPromotion = dynamic(() => + import('@/lib/home/components/PromotionProgram'), +{ + loading: () => , +} +); const BannerSection = dynamic(() => import('@/lib/home/components/BannerSection') @@ -56,23 +58,12 @@ const BannerSection = dynamic(() => const CategoryHomeId = dynamic(() => import('@/lib/home/components/CategoryHomeId') ); - -const CategoryDynamic = dynamic(() => - import('@/lib/home/components/CategoryDynamic') -); - -const CategoryDynamicMobile = dynamic(() => -import('@/lib/home/components/CategoryDynamicMobile') -); - const CustomerReviews = dynamic(() => import('@/lib/review/components/CustomerReviews') ); const ServiceList = dynamic(() => import('@/lib/home/components/ServiceList')); - - -export default function Home({categoryId}) { +export default function Home() { const bannerRef = useRef(null); const wrapperRef = useRef(null); @@ -83,18 +74,6 @@ export default function Home({categoryId}) { bannerRef.current?.querySelector(':first-child')?.clientHeight + 'px'; }; - useEffect(() => { - const loadCategories = async () => { - const getCategories = await odooApi('GET', '/api/v1/category/child?partner_id='+{categoryId}) - if(getCategories){ - setDataCategories(getCategories) - } - } - loadCategories() - }, []) - - const [dataCategories, setDataCategories] = useState([]) - return (
-
@@ -148,13 +126,10 @@ export default function Home({categoryId}) { )} - -
-
@@ -162,7 +137,7 @@ export default function Home({categoryId}) { -
+
@@ -174,7 +149,7 @@ export default function Home({categoryId}) { {!auth?.feature?.soApproval && ( <> - {/* */} + @@ -184,10 +159,6 @@ export default function Home({categoryId}) { - - - - -- cgit v1.2.3