From af35f7c31c65b6fb42c67424674f1f8acd68a5a1 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 17 May 2023 16:08:45 +0700
Subject: Fix banner url

---
 src/core/components/elements/Navbar/TopBanner.jsx | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

(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 48b23a3d..9efd0a8d 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -1,6 +1,7 @@
 import odooApi from '@/core/api/odooApi'
 import { useQuery } from 'react-query'
 import Image from 'next/image'
+import Link from '../Link/Link'
 
 const TopBanner = () => {
   const fetchTopBanner = async () => await odooApi('GET', '/api/v1/banner?type=top-banner')
@@ -10,13 +11,15 @@ const TopBanner = () => {
     topBanner.isFetched &&
     topBanner.data?.length > 0 && (
       <div style={{ backgroundColor: topBanner.data[0]?.backgroundColor || 'transparent' }}>
-        <Image
-          src={topBanner.data[0].image}
-          alt={topBanner.data[0].name}
-          width={1440}
-          height={40}
-          className='object-cover object-center h-full mx-auto'
-        />
+        <Link href={topBanner.data[0]?.url}>
+          <Image
+            src={topBanner.data[0].image}
+            alt={topBanner.data[0].name}
+            width={1440}
+            height={40}
+            className='object-cover object-center h-full mx-auto'
+          />
+        </Link>
       </div>
     )
   )
-- 
cgit v1.2.3

