From 16fed2e7d00252f5df3f9b5bdf0a5a2b2a094f76 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 8 Aug 2023 10:39:34 +0700
Subject: Improve home page performance

---
 src/core/components/elements/Navbar/TopBanner.jsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'src/core/components/elements/Navbar/TopBanner.jsx')

diff --git a/src/core/components/elements/Navbar/TopBanner.jsx b/src/core/components/elements/Navbar/TopBanner.jsx
index 9efd0a8d..dca2e930 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -2,11 +2,16 @@ import odooApi from '@/core/api/odooApi'
 import { useQuery } from 'react-query'
 import Image from 'next/image'
 import Link from '../Link/Link'
+import { TopBannerSkeleton } from '../Skeleton/TopBannerSkeleton'
 
 const TopBanner = () => {
   const fetchTopBanner = async () => await odooApi('GET', '/api/v1/banner?type=top-banner')
   const topBanner = useQuery('topBanner', fetchTopBanner)
 
+  if (topBanner.isLoading) {
+    return <TopBannerSkeleton />
+  }
+
   return (
     topBanner.isFetched &&
     topBanner.data?.length > 0 && (
-- 
cgit v1.2.3

