From 38c9fbb245aeb315e90f42c281a17257a5eeb122 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 5 Apr 2023 09:46:31 +0700
Subject: forgot and reset password

---
 src/pages/index.jsx | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 1102cc1b..2a996b5d 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -3,9 +3,12 @@ import ImageSkeleton from '@/core/components/elements/Skeleton/ImageSkeleton'
 import PopularProductSkeleton from '@/lib/home/components/Skeleton/PopularProductSkeleton'
 import MobileView from '@/core/components/views/MobileView'
 import DesktopView from '@/core/components/views/DesktopView'
-import { useRef } from 'react'
+import { useEffect, useRef, useState } from 'react'
 import { NextSeo } from 'next-seo'
 import Seo from '@/core/components/Seo'
+import { useQuery } from 'react-query'
+import odooApi from '@/core/api/odooApi'
+import Image from '@/core/components/elements/Image/Image'
 
 const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
 
@@ -26,6 +29,9 @@ const CategoryHomeId = dynamic(() => import('@/lib/home/components/CategoryHomeI
 })
 
 export default function Home() {
+  const fetchSecondHeroBanner = async () => await odooApi('GET', '/api/v1/banner?type=index-b-2')
+  const secondHeroBanner = useQuery('secondHeroBanner', fetchSecondHeroBanner)
+
   const bannerRef = useRef(null)
   const wrapperRef = useRef(null)
 
@@ -51,7 +57,11 @@ export default function Home() {
       <DesktopView>
         <div className='container mx-auto'>
           <div className='flex h-[360px]' ref={wrapperRef} onLoad={handleOnLoad}>
-            <div className='w-3/12'></div>
+            <div className='w-3/12'>
+              {secondHeroBanner.isFetched && (
+                <Image src={secondHeroBanner.data[0].image} alt={secondHeroBanner.data[0].name} />
+              )}
+            </div>
             <div className='w-6/12 px-1' ref={bannerRef}>
               <HeroBanner />
             </div>
-- 
cgit v1.2.3

