summaryrefslogtreecommitdiff
path: root/src/lib/home/components
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-05-19 16:39:28 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-05-19 16:39:28 +0700
commit0e2ac6ec63944d8bebb123a862b18e337cbbbfbd (patch)
treefbdb1e9c9f726bdf9bbd81a989fa94f3e241862d /src/lib/home/components
parentbaf0447595815be64312ac836e5f8bb403e4dcfc (diff)
Fix return null if no banner section
Diffstat (limited to 'src/lib/home/components')
-rw-r--r--src/lib/home/components/BannerSection.jsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/home/components/BannerSection.jsx b/src/lib/home/components/BannerSection.jsx
index 8459d08e..dfef071f 100644
--- a/src/lib/home/components/BannerSection.jsx
+++ b/src/lib/home/components/BannerSection.jsx
@@ -9,7 +9,8 @@ const BannerSection = () => {
const bannerSection = useQuery('bannerSection', fetchBannerSection)
return (
- bannerSection.data && (
+ bannerSection.data &&
+ bannerSection.data?.length > 0 && (
<div className='grid grid-cols-1 sm:grid-cols-2 gap-4'>
{bannerSection.data?.map((banner) => (
<Link key={banner.id} href={banner.url}>