From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 17 Feb 2023 17:07:50 +0700 Subject: Refactor --- src/lib/brand/components/Brand.jsx | 70 ++++++++++++++++++++++++++++++++++ src/lib/brand/components/BrandCard.jsx | 20 ++++++++++ 2 files changed, 90 insertions(+) create mode 100644 src/lib/brand/components/Brand.jsx create mode 100644 src/lib/brand/components/BrandCard.jsx (limited to 'src/lib/brand/components') diff --git a/src/lib/brand/components/Brand.jsx b/src/lib/brand/components/Brand.jsx new file mode 100644 index 00000000..a42f4c81 --- /dev/null +++ b/src/lib/brand/components/Brand.jsx @@ -0,0 +1,70 @@ +import useBrand from "../hooks/useBrand" +import Image from "@/core/components/elements/Image/Image" + +import { Swiper, SwiperSlide } from "swiper/react" +import { Pagination, Autoplay } from "swiper" +import "swiper/css" +import "swiper/css/pagination" +import "swiper/css/autoplay" +import Divider from "@/core/components/elements/Divider/Divider" +import ImageSkeleton from "@/core/components/elements/Skeleton/ImageSkeleton" + +const swiperBanner = { + pagination: { dynamicBullets: true }, + autoplay: { + delay: 6000, + disableOnInteraction: false + }, + modules: [Pagination, Autoplay] +} + +const Brand = ({ id }) => { + const { brand } = useBrand({ id }) + + return ( + <> +
+ { brand.isLoading && } + { brand.data && ( + <> + + { brand.data?.banners?.map((banner, index) => ( + + {`Brand + + )) } + +
+
Produk dari brand:
+ { brand?.data?.logo && ( + {brand?.data?.name} + ) } + { !brand?.data?.logo && ( +
+ { brand?.data?.name } +
+ ) } +
+ + ) } +
+ + + ) +} + +export default Brand \ No newline at end of file diff --git a/src/lib/brand/components/BrandCard.jsx b/src/lib/brand/components/BrandCard.jsx new file mode 100644 index 00000000..8783010e --- /dev/null +++ b/src/lib/brand/components/BrandCard.jsx @@ -0,0 +1,20 @@ +import Image from "@/core/components/elements/Image/Image" +import Link from "@/core/components/elements/Link/Link" +import { createSlug } from "@/core/utils/slug" + +const BrandCard = ({ brand }) => { + return ( + + {brand.name} + + ) +} + +export default BrandCard \ No newline at end of file -- cgit v1.2.3