diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-13 17:09:53 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-13 17:09:53 +0700 |
| commit | a88dbd7f7b271e78290506fdc61d68adba5d0019 (patch) | |
| tree | 43f89a761f7b72cc936e45004a4fbda2f445f92c /src/pages/index.js | |
| parent | ada443445767679dd2d2b2c889bfac02609778b8 (diff) | |
Fixing
Diffstat (limited to 'src/pages/index.js')
| -rw-r--r-- | src/pages/index.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/pages/index.js b/src/pages/index.js index dd81e817..65999ff6 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -18,6 +18,15 @@ import Footer from "@/components/layouts/Footer"; import Image from "@/components/elements/Image"; import ProductCategories from "@/components/products/ProductCategories"; +const swiperBanner = { + pagination: { dynamicBullets: true }, + autoplay: { + delay: 6000, + disableOnInteraction: false + }, + modules: [Pagination, Autoplay] +} + export async function getServerSideProps() { const heroBanners = await apiOdoo('GET', `/api/v1/banner?type=index-a-1`); @@ -48,12 +57,9 @@ export default function Home({ heroBanners }) { <Layout> <Swiper slidesPerView={1} - pagination={{dynamicBullets: true}} - modules={[Pagination, Autoplay]} - autoplay={{ - delay: 6000, - disableOnInteraction: false - }} + pagination={swiperBanner.pagination} + modules={swiperBanner.modules} + autoplay={swiperBanner.autoplay} > { heroBanners?.map((banner, index) => ( @@ -79,7 +85,7 @@ export default function Home({ heroBanners }) { } </Swiper> </div> - <div className="my-6 p-4 pt-0"> + <div className="my-6 p-4 py-0"> <h2 className="mb-4">Produk Populer</h2> <ProductSlider products={popularProducts} simpleProductTitleLine /> </div> |
