From 33da0fcb718335eb1d077af4321ac65e0146a2d6 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 22 May 2023 11:58:05 +0700
Subject: Refactoring hero banner feature

---
 src/lib/home/components/HeroBanner.jsx | 70 ----------------------------------
 1 file changed, 70 deletions(-)
 delete mode 100644 src/lib/home/components/HeroBanner.jsx

(limited to 'src/lib/home/components/HeroBanner.jsx')

diff --git a/src/lib/home/components/HeroBanner.jsx b/src/lib/home/components/HeroBanner.jsx
deleted file mode 100644
index 889bb2ce..00000000
--- a/src/lib/home/components/HeroBanner.jsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import ImageSkeleton from '@/core/components/elements/Skeleton/ImageSkeleton'
-import useHeroBanner from '../hooks/useHeroBanner'
-import Image from '@/core/components/elements/Image/Image'
-
-// Swiper
-import { Swiper, SwiperSlide } from 'swiper/react'
-import { Pagination, Autoplay } from 'swiper'
-import 'swiper/css'
-import 'swiper/css/pagination'
-import 'swiper/css/autoplay'
-import MobileView from '@/core/components/views/MobileView'
-import DesktopView from '@/core/components/views/DesktopView'
-import Link from '@/core/components/elements/Link/Link'
-
-const HeroBanner = () => {
-  const { heroBanners } = useHeroBanner()
-
-  const swiperBanner = {
-    autoplay: {
-      delay: 6000,
-      disableOnInteraction: false
-    },
-    modules: [Pagination, Autoplay],
-    loop: true
-  }
-
-  const swiperBannerMobile = {
-    ...swiperBanner,
-    pagination: { dynamicBullets: true, clickable: true }
-  }
-
-  const swiperBannerDesktop = {
-    ...swiperBanner,
-    pagination: { dynamicBullets: false, clickable: true }
-  }
-
-  return (
-    <div className='min-h-[200px]'>
-      {heroBanners.isLoading && <ImageSkeleton />}
-      {!heroBanners.isLoading && (
-        <>
-          <MobileView>
-            <Swiper slidesPerView={1} className='border border-gray_r-6' {...swiperBannerMobile}>
-              {heroBanners.data?.map((banner, index) => (
-                <SwiperSlide key={index}>
-                  <Link href={banner.url || ''} className='w-full h-auto'>
-                    <Image src={banner.image} alt={banner.name} className='w-full h-auto' />
-                  </Link>
-                </SwiperSlide>
-              ))}
-            </Swiper>
-          </MobileView>
-          <DesktopView>
-            <Swiper slidesPerView={1} className='border border-gray_r-6' {...swiperBannerDesktop}>
-              {heroBanners.data?.map((banner, index) => (
-                <SwiperSlide key={index}>
-                  <Link href={banner.url || ''} className='w-full h-auto'>
-                    <Image src={banner.image} alt={banner.name} className='w-full h-auto' />
-                  </Link>
-                </SwiperSlide>
-              ))}
-            </Swiper>
-          </DesktopView>
-        </>
-      )}
-    </div>
-  )
-}
-
-export default HeroBanner
-- 
cgit v1.2.3

