summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-07 17:08:09 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-07 17:08:09 +0700
commitc88d98f06a6301bad6dd6d2e58b4908d8562638c (patch)
tree282633b855acf235fe1d0d78b67d8cd46e032c03 /src/pages
parent6ac1792ee37e5a5a9438f61e708966c944b61914 (diff)
<iman> add promotion program
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/index.jsx7
-rw-r--r--src/pages/shop/promo/[slug].jsx46
-rw-r--r--src/pages/shop/promo/index.jsx0
3 files changed, 53 insertions, 0 deletions
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: () => <FlashSaleSkeleton />,
}
);
+
+const ProgramPromotion = dynamic(() =>
+ import('@/lib/home/components/PromotionProgram')
+);
+
const BannerSection = dynamic(() =>
import('@/lib/home/components/BannerSection')
);
@@ -103,6 +108,7 @@ export default function Home() {
<PreferredBrand />
</div>
<FlashSale />
+ <ProgramPromotion/>
<PromotinProgram />
<CategoryHomeId />
<BannerSection />
@@ -126,6 +132,7 @@ export default function Home() {
</DelayRender>
<DelayRender renderAfter={600}>
<FlashSale />
+ <ProgramPromotion/>
</DelayRender>
<DelayRender renderAfter={600}>
<PromotinProgram />
diff --git a/src/pages/shop/promo/[slug].jsx b/src/pages/shop/promo/[slug].jsx
new file mode 100644
index 00000000..4211ceb8
--- /dev/null
+++ b/src/pages/shop/promo/[slug].jsx
@@ -0,0 +1,46 @@
+import dynamic from 'next/dynamic'
+import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug'
+import { useRouter } from 'next/router'
+import _ from 'lodash'
+import Seo from '@/core/components/Seo'
+import Promocrumb from '@/lib/promo/components/Promocrumb'
+import useBrand from '@/lib/brand/hooks/useBrand'
+
+const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
+const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch'))
+const Brand = dynamic(() => import('@/lib/brand/components/Brand'))
+
+export default function BrandDetail() {
+ const router = useRouter()
+ const { slug = '' } = router.query
+ console.log("apa itu slug",slug)
+ const brandName = getNameFromSlug(slug)
+ const id = getIdFromSlug(slug)
+ const {brand} = useBrand({id})
+ return (
+ <BasicLayout>
+ {/* seakarang arahkan web untuk menampilkan daftar promo sesuai slug */}
+
+ <Seo
+ title={`Promo ${slug} Terkini`}
+ description='B2B Marketplace MRO &amp; Industri dengan Layanan Pembayaran Tempo, Faktur Pajak, Online Quotation, Garansi Resmi &amp; Harga Kompetitif'
+
+ />
+
+ <Promocrumb brandName={slug} />
+
+ harusnya disini menampilkan barang promosimya {slug}
+
+
+ {/* <Brand brand={brand} />
+ {!_.isEmpty(router.query) && (
+ <ProductSearch
+ query={_.omit(router.query, 'slug')}
+ prefixUrl={`/shop/promo/${slug}`}
+ defaultBrand={getNameFromSlug(slug)}
+ brand={brand}
+ />
+ )} */}
+ </BasicLayout>
+ )
+}
diff --git a/src/pages/shop/promo/index.jsx b/src/pages/shop/promo/index.jsx
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/pages/shop/promo/index.jsx