From aad3092b7c2b293333d894a192c8056f6502c9a0 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 29 Jul 2024 14:15:41 +0700
Subject: <iman> update top banner

---
 src/core/components/elements/Navbar/TopBanner.jsx | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 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 722a7501..83ef8c7a 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -4,6 +4,7 @@ import { useQuery } from 'react-query';
 import odooApi from '@/core/api/odooApi';
 import SmoothRender from '~/components/ui/smooth-render';
 import Link from '../Link/Link';
+import { background } from '@chakra-ui/react';
 
 const TopBanner = () => {
   const topBanner = useQuery({
@@ -12,7 +13,7 @@ const TopBanner = () => {
     refetchOnWindowFocus: false,
   });
 
-  const backgroundColor = topBanner.data?.[0]?.backgroundColor || 'transparent';
+  // const backgroundColor = topBanner.data?.[0]?.backgroundColor || 'transparent';
   const hasData = topBanner.data?.length > 0;
   const data = topBanner.data?.[0] || null;
 
@@ -22,16 +23,17 @@ const TopBanner = () => {
       height='36px'
       duration='700ms'
       delay='300ms'
-      style={{ backgroundColor }}
     >
-      <Link href={data?.url}>
-        <Image
-          src={data?.image}
-          alt={data?.name}
-          width={1440}
-          height={40}
-          className='object-cover object-center h-full mx-auto'
-        />
+     <Link
+        href={data?.url}
+        className="block"
+        style={{
+          backgroundImage: `url('${data?.image}')`,
+          backgroundPosition: 'center',
+          backgroundSize: 'cover',
+          height: '36px',
+        }}
+      >
       </Link>
     </SmoothRender>
   );
-- 
cgit v1.2.3


From de27df05af1f23d70099d36d11e07f35faff26c6 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 30 Jul 2024 13:25:14 +0700
Subject: <iman> update mobile view

---
 src/core/components/elements/Navbar/TopBanner.jsx | 29 +++++++++++------------
 1 file changed, 14 insertions(+), 15 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 83ef8c7a..df47e87d 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -1,12 +1,12 @@
 import Image from 'next/image';
-import { useQuery } from 'react-query';
-
+import { useQuery } from 'react-query';import useDevice from '@/core/hooks/useDevice'
 import odooApi from '@/core/api/odooApi';
 import SmoothRender from '~/components/ui/smooth-render';
 import Link from '../Link/Link';
 import { background } from '@chakra-ui/react';
 
 const TopBanner = () => {
+  const { isDesktop, isMobile } = useDevice()
   const topBanner = useQuery({
     queryKey: 'topBanner',
     queryFn: async () => await odooApi('GET', '/api/v1/banner?type=top-banner'),
@@ -20,22 +20,21 @@ const TopBanner = () => {
   return (
     <SmoothRender
       isLoaded={hasData}
-      height='36px'
+      // height='36px'
       duration='700ms'
       delay='300ms'
-    >
-     <Link
-        href={data?.url}
-        className="block"
-        style={{
-          backgroundImage: `url('${data?.image}')`,
-          backgroundPosition: 'center',
-          backgroundSize: 'cover',
-          height: '36px',
-        }}
+      className='h-auto'
       >
-      </Link>
-    </SmoothRender>
+      <Link
+          href={data?.url}
+          className="block bg-cover bg-center h-3 md:h-6 lg:h-[36px]"
+          style={{
+            backgroundImage: `url('${data?.image}')`,
+          }}
+        >
+        </Link>
+
+      </SmoothRender>
   );
 };
 
-- 
cgit v1.2.3


From 16db179d5bb5ebd3ce946fb6e682539ffc8f728e Mon Sep 17 00:00:00 2001
From: Imanuel Marinao <imanuel.mariano.5@gmail.com>
Date: Tue, 20 Aug 2024 20:40:32 +0700
Subject: <iman> update avoid error

---
 src/core/components/elements/Navbar/TopBanner.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(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 5ea8f635..f438ae67 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -6,7 +6,7 @@ import Link from '../Link/Link';
 import { background } from '@chakra-ui/react';
 import { useEffect } from 'react';
 
-const TopBanner = ({ onLoad }) => {
+const TopBanner = ({ onLoad = () => {} }) => {
   const { isDesktop, isMobile } = useDevice()
   const topBanner = useQuery({
     queryKey: 'topBanner',
-- 
cgit v1.2.3

