summaryrefslogtreecommitdiff
path: root/src/lib/home
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
commit92c2a229d9c9b510d71b928978872a8b107e9d5a (patch)
tree8d8161a49a0bdc46d4c28d3f2682bb485314a41d /src/lib/home
parent62bebc1d33fd090d7666e18e7a0326ef7ef36897 (diff)
Documentation and refactor code
Diffstat (limited to 'src/lib/home')
-rw-r--r--src/lib/home/components/PopularProduct.jsx15
-rw-r--r--src/lib/home/components/PreferredBrand.jsx11
2 files changed, 5 insertions, 21 deletions
diff --git a/src/lib/home/components/PopularProduct.jsx b/src/lib/home/components/PopularProduct.jsx
index 78dc5d49..3ce7527e 100644
--- a/src/lib/home/components/PopularProduct.jsx
+++ b/src/lib/home/components/PopularProduct.jsx
@@ -15,10 +15,7 @@ const PopularProduct = () => {
<div className='font-medium mb-4'>Produk Banyak Dilihat</div>
{popularProducts.isLoading && <PopularProductSkeleton />}
{!popularProducts.isLoading && (
- <ProductSlider
- products={popularProducts.data}
- simpleTitle
- />
+ <ProductSlider products={popularProducts.data} simpleTitle />
)}
</div>
</MobileView>
@@ -31,14 +28,8 @@ const PopularProduct = () => {
<div className='h-full divide-y divide-gray_r-6'>
{popularProducts.data &&
popularProducts.data.products.map((product) => (
- <div
- className='py-2'
- key={product.id}
- >
- <ProductCard
- product={product}
- variant='horizontal'
- />
+ <div className='py-2' key={product.id}>
+ <ProductCard product={product} variant='horizontal' />
</div>
))}
</div>
diff --git a/src/lib/home/components/PreferredBrand.jsx b/src/lib/home/components/PreferredBrand.jsx
index 7edd0730..f97943cb 100644
--- a/src/lib/home/components/PreferredBrand.jsx
+++ b/src/lib/home/components/PreferredBrand.jsx
@@ -14,21 +14,14 @@ const PreferredBrand = () => {
<div className='flex justify-between items-center mb-4'>
<div className='font-medium sm:text-h-lg'>Brand Pilihan</div>
{isDesktop && (
- <Link
- href='/'
- className='btn-yellow !text-gray_r-12'
- >
+ <Link href='/' className='btn-yellow !text-gray_r-12'>
Lihat Semua
</Link>
)}
</div>
{preferredBrands.isLoading && <PreferredBrandSkeleton />}
{!preferredBrands.isLoading && (
- <Swiper
- slidesPerView={isMobile ? 3.5 : 7.5}
- spaceBetween={isMobile ? 12 : 24}
- freeMode
- >
+ <Swiper slidesPerView={isMobile ? 3.5 : 7.5} spaceBetween={isMobile ? 12 : 24} freeMode>
{preferredBrands.data?.manufactures.map((brand) => (
<SwiperSlide key={brand.id}>
<BrandCard brand={brand} />