From baf0447595815be64312ac836e5f8bb403e4dcfc Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 19 May 2023 16:31:42 +0700 Subject: banner section and product category banner url --- src/lib/home/components/BannerSection.jsx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/lib/home/components/BannerSection.jsx (limited to 'src/lib/home/components/BannerSection.jsx') diff --git a/src/lib/home/components/BannerSection.jsx b/src/lib/home/components/BannerSection.jsx new file mode 100644 index 00000000..8459d08e --- /dev/null +++ b/src/lib/home/components/BannerSection.jsx @@ -0,0 +1,30 @@ +import Link from '@/core/components/elements/Link/Link' +import Image from 'next/image' + +const { useQuery } = require('react-query') +const { default: bannerSectionApi } = require('../api/bannerSectionApi') + +const BannerSection = () => { + const fetchBannerSection = async () => await bannerSectionApi() + const bannerSection = useQuery('bannerSection', fetchBannerSection) + + return ( + bannerSection.data && ( +
+ {bannerSection.data?.map((banner) => ( + + {banner.name} + + ))} +
+ ) + ) +} + +export default BannerSection -- cgit v1.2.3