summaryrefslogtreecommitdiff
path: root/src/lib/brand
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-05-08 16:44:09 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-05-08 16:44:09 +0700
commit486f85a45fc7e0669576f59824a31be472ed25bb (patch)
tree0268afa8efe48746e040611ba41ad2cafda7ad08 /src/lib/brand
parentcff198277e14450f8d20d9e18548325e6f277682 (diff)
parent30fc50600009ca54f085d594d838803c107e87f2 (diff)
Merge branch 'master' into development_tri/implementasi_raja_ongkir
# Conflicts: # src/lib/checkout/components/Checkout.jsx
Diffstat (limited to 'src/lib/brand')
-rw-r--r--src/lib/brand/components/Brand.jsx29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/brand/components/Brand.jsx b/src/lib/brand/components/Brand.jsx
index 6ebb8aa7..3c411969 100644
--- a/src/lib/brand/components/Brand.jsx
+++ b/src/lib/brand/components/Brand.jsx
@@ -1,5 +1,5 @@
import useBrand from '../hooks/useBrand'
-import Image from '@/core/components/elements/Image/Image'
+import Image from 'next/image'
import { Swiper, SwiperSlide } from 'swiper/react'
import { Pagination, Autoplay } from 'swiper'
@@ -29,6 +29,15 @@ const Brand = ({ id }) => {
<>
<div>
{brand.isLoading && <ImageSkeleton />}
+ {brand.data?.banners?.length == 0 && (
+ <Image
+ src='/images/default-banner-brand.jpg'
+ alt='Brand - Indoteknik'
+ width={1024}
+ height={512}
+ className='w-full h-auto'
+ />
+ )}
{brand.data && (
<>
<Swiper
@@ -43,6 +52,8 @@ const Brand = ({ id }) => {
<Image
src={banner}
alt={`Brand ${brand.data?.name} - Indoteknik`}
+ width={1024}
+ height={512}
className='w-full h-auto'
/>
</SwiperSlide>
@@ -55,6 +66,8 @@ const Brand = ({ id }) => {
src={brand?.data?.logo}
alt={brand?.data?.name}
className='w-32 p-2 border borde-gray_r-6 rounded'
+ width={256}
+ height={128}
/>
)}
{!brand?.data?.logo && (
@@ -69,10 +82,20 @@ const Brand = ({ id }) => {
<Divider />
</>
</MobileView>
+
<DesktopView>
<div className='container mx-auto mt-10 mb-3'>
<div className='min-h-[150px]'>
{brand.isLoading && <ImageSkeleton />}
+ {brand.data?.banners?.length == 0 && (
+ <Image
+ src='/images/default-banner-brand.jpg'
+ alt='Brand - Indoteknik'
+ width={1024}
+ height={512}
+ className='w-full h-auto'
+ />
+ )}
{brand.data && (
<>
<Swiper
@@ -87,6 +110,8 @@ const Brand = ({ id }) => {
<Image
src={banner}
alt={`Brand ${brand.data?.name} - Indoteknik`}
+ width={1024}
+ height={512}
className='w-full h-auto'
/>
</SwiperSlide>
@@ -99,6 +124,8 @@ const Brand = ({ id }) => {
src={brand?.data?.logo}
alt={brand?.data?.name}
className='w-32 p-2 border borde-gray_r-6 rounded'
+ width={1024}
+ height={512}
/>
)}
{!brand?.data?.logo && (