summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/home/components/CategoryPilihan.jsx38
-rw-r--r--src/lib/product/components/CategorySection.jsx22
-rw-r--r--src/lib/product/components/ProductSearch.jsx7
3 files changed, 39 insertions, 28 deletions
diff --git a/src/lib/home/components/CategoryPilihan.jsx b/src/lib/home/components/CategoryPilihan.jsx
index c506ef29..3f1066e2 100644
--- a/src/lib/home/components/CategoryPilihan.jsx
+++ b/src/lib/home/components/CategoryPilihan.jsx
@@ -1,30 +1,40 @@
import Image from 'next/image'
import useCategoryHome from '../hooks/useCategoryHome'
+import Link from '@/core/components/elements/Link/Link'
+import { createSlug } from '@/core/utils/slug'
const CategoryPilihan = ({ id, categories }) => {
const { categoryHome } = useCategoryHome({ id })
-
+ console.log("id",id)
+ console.log("categories",categories)
return (
<section>
- <div className='flex flex-row items-center gap-4'>
- <h1>Kategori Pilihan</h1>
- <p className='text-gray_r-10'>total produk</p>
+ <div className='flex flex-row items-center mb-4'>
+ <div className='font-semibold sm:text-h-lg mr-2'>Kategori Pilihan</div>
+ <p className='text-gray_r-10 text-sm'>200 Rb+ Produk Unggulan & 800+ Brand Rekomendasi tersedia!</p>
</div>
- <div className="group/item grid grid-cols-6 gap-2 w-full h-full col-span-2 border">
+ <div className="group/item grid grid-cols-6 gap-y-2 w-full h-full col-span-2 ">
{categories.map((category) => (
- <div className="max-w-sm w-full gap-4 lg:max-w-full flex flex-col bg-white px-4 py-2 border-2 border-gray_r-8 rounded-lg">
- <div className="group/edit flex items-center justify-center group-hover/item:visible">
- <Image src='group-hover/ https://erp.indoteknik.com/api/image/product.template/image_256/544371?ratio=square' width={80} height={80} alt={category?.name} />
- <a class="group/edit invisible hover:bg-slate-200 group-hover/item:visible ..." href="tel:{person.phone}">
- <span class="group-hover/edit:text-gray-700 ...">Call</span>
- </a>
+ <div className="KartuInti h-48 w-60 max-w-sm lg:max-w-full flex flex-col border-[1px] border-gray-200 relative group">
+ <div className='KartuB absolute h-48 w-60 inset-0 flex items-center justify-center '>
+ <div className="group/edit flex items-center justify-center h-48 w-60 flex-col group-hover/item:visible">
+ <div className=' h-36'>
+ <Image className='group-hover:scale-110 transition-transform duration-300' src='https://erp.indoteknik.com/api/image/product.template/image_256/544371?ratio=square' width={120} height={120} alt={category?.name} />
+ </div>
+ <h2 className="text-gray-700 content-center h-12 border-t-[1px] px-1 w-60 border-gray-200 font-normal text-sm text-center">{category?.name}</h2>
+ </div>
</div>
- <div className="flex flex-col justify-center leading-normal items-center">
- <h2 className="text-gray-900 font-bold text-sm items-center text-center">{category?.name}</h2>
+ <div className='KartuA relative inset-0 flex h-36 w-60 items-center justify-center opacity-0 group-hover:opacity-75 group-hover:bg-[#E20613] transition-opacity '>
+ <Link
+ href={createSlug('/shop/category/', category?.name, category?.id)}
+ className='category-mega-box__parent text-white rounded-lg'
+ >
+ Lihat semua
+ </Link>
</div>
</div>
))}
- </div>
+ </div>
</section>
)
}
diff --git a/src/lib/product/components/CategorySection.jsx b/src/lib/product/components/CategorySection.jsx
index 7c347fe8..c250efeb 100644
--- a/src/lib/product/components/CategorySection.jsx
+++ b/src/lib/product/components/CategorySection.jsx
@@ -1,20 +1,24 @@
import Image from "next/image"
+import Link from '@/core/components/elements/Link/Link'
+import { createSlug } from '@/core/utils/slug'
const CategorySection = ({ categories }) => {
return (
- <section className="items-center bg-danger-100">
- <div className="grid grid-cols-4 gap-2 w-full h-full col-span-2">
+ <section>
+ <div className="group/item grid grid-cols-5 gap-y-2 w-full h-full col-span-2 ">
{categories.map((category) => (
- <div class="max-w-sm w-fit gap-4 lg:max-w-full lg:flex bg-white px-4 py-2 border-2 border-gray_r-8 rounded-lg">
- <div className="flex items-center justify-center">
- <Image src='https://erp.indoteknik.com/api/image/product.template/image_256/544371?ratio=square' width={80} height={80} alt={category?.name} />
- </div>
- <div class="flex flex-col justify-center leading-normal">
- <h2 class="text-gray-900 font-bold text-sm">{category?.name}</h2>
+ <div className="KartuInti h-24 w-26 max-w-sm lg:max-w-full flex flex-col border-[1px] border-gray-200 relative group">
+ <div className='KartuB absolute h-48 w-60 inset-0 flex items-center justify-center '>
+ <div className="group/edit flex items-center justify-center h-48 w-60 flex-row group-hover/item:visible">
+ <div className=' h-36'>
+ <Image className="group-hover:scale-110 duration-300" src='https://erp.indoteknik.com/api/image/product.template/image_256/544371?ratio=square' width={36} height={26} alt={category?.name} />
+ </div>
+ <h2 className="text-gray-700 content-center text-wrap h-12 border-t-[1px] w-60 px-1 border-gray-200 font-normal text-sm text-center">{category?.name}</h2>
+ </div>
</div>
</div>
))}
- </div>
+ </div>
</section>
)
}
diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx
index 253c3703..29cf94da 100644
--- a/src/lib/product/components/ProductSearch.jsx
+++ b/src/lib/product/components/ProductSearch.jsx
@@ -74,7 +74,6 @@ const ProductSearch = ({
const categoryId = getIdFromSlug(prefixUrl)
-
useEffect(() => {
if (productFound == 0 && query.q && !spellings) {
searchSpellApi({ query: query.q }).then((response) => {
@@ -121,18 +120,16 @@ const ProductSearch = ({
checkIfBrand();
}
}, [q]);
-
+
useEffect(() => {
const loadCategories = async () => {
- const getCategories = await odooApi('GET', '/api/v1/category/child?partner_id='+{categoryId})
+ const getCategories = await odooApi('GET', `/api/v1/category/child?parent_id=${categoryId}`)
if(getCategories){
setDataCategories(getCategories)
}
}
loadCategories()
}, [])
-
- console.log('Data Category : ', dataCategories)
const brands = [];
for (