summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/ui/HeroBanner.jsx2
-rw-r--r--src/core/components/elements/Navbar/NavbarDesktop.jsx12
-rw-r--r--src/lib/product/components/Product/ProductDesktop.jsx1
-rw-r--r--src/lib/product/components/Product/ProductMobile.jsx1
-rw-r--r--src/lib/product/components/ProductCard.jsx6
-rw-r--r--src/lib/product/components/ProductSlider.jsx2
-rw-r--r--src/pages/api/hero-banner.js2
7 files changed, 20 insertions, 6 deletions
diff --git a/src/components/ui/HeroBanner.jsx b/src/components/ui/HeroBanner.jsx
index 3025fc1e..6f1ef641 100644
--- a/src/components/ui/HeroBanner.jsx
+++ b/src/components/ui/HeroBanner.jsx
@@ -55,7 +55,7 @@ const HeroBanner = () => {
return heroBanner.map((banner, index) => (
<SwiperSlide key={index}>
- <Link href={banner.url} className='w-full h-auto'>
+ <Link href={banner.url} className='w-full h-auto' aria-label={banner.name}>
<Image
src={banner.image}
alt={banner.name}
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index 7d6d8c9e..253a2b03 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -192,7 +192,7 @@ const NavbarDesktop = () => {
<nav className='pt-6 sticky top-0 z-50 bg-white border-b-2 border-danger-500'>
<div className='container mx-auto flex gap-x-6'>
- <Link href='/'>
+ <Link href='/' aria-label='Indoteknik Logo'>
<Image
src={IndoteknikLogo}
alt='Indoteknik Logo'
@@ -217,6 +217,7 @@ const NavbarDesktop = () => {
target='_blank'
rel='noreferrer'
href='/my/wishlist'
+ aria-label='Wishlist'
className='flex items-center gap-x-2 !text-gray_r-12/80'
>
<HeartIcon className='w-7' />
@@ -224,6 +225,7 @@ const NavbarDesktop = () => {
</Link>
<a
href={whatsappUrl(templateWA, payloadWA, urlPath)}
+ aria-label='Whatsapp'
target='_blank'
rel='noreferrer'
className='flex items-center gap-x-1 !text-gray_r-12/80'
@@ -266,6 +268,7 @@ const NavbarDesktop = () => {
<div className='w-6/12 flex px-1 divide-x divide-gray_r-6'>
<Link
href='/shop/promo'
+ aria-label='Promo'
className={`${
router.asPath === '/shop/promo' && 'bg-gray_r-3'
} flex-1 flex justify-center items-center !text-gray_r-12/80 hover:bg-gray_r-3 idt-transition group relative`} // Added relative position
@@ -300,6 +303,7 @@ const NavbarDesktop = () => {
<Link
href='/shop/brands'
+ aria-label='Brand'
className={`${
router.asPath === '/shop/brands' && 'bg-gray_r-3'
} p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 hover:bg-gray_r-3 idt-transition group`}
@@ -312,6 +316,7 @@ const NavbarDesktop = () => {
</Link>
<Link
href='/shop/search?orderBy=stock'
+ aria-label='Ready Stock'
className={`${
router.asPath.includes('/shop/search?orderBy=stock') &&
'bg-gray_r-3'
@@ -325,6 +330,7 @@ const NavbarDesktop = () => {
</Link>
<Link
href='https://blog.indoteknik.com/'
+ aria-label='Blog Indoteknik'
className='p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 hover:bg-gray_r-3 idt-transition group'
target='_blank'
rel='noreferrer noopener'
@@ -348,12 +354,14 @@ const NavbarDesktop = () => {
<>
<Link
href='/login'
+ aria-label='Login'
className='flex-1 flex justify-center items-center bg-danger-500 !text-gray_r-1 rounded-none rounded-t-xl'
>
Masuk
</Link>
<Link
href='/register'
+ aria-label='Register'
className='flex-1 flex justify-center items-center bg-danger-500 !text-gray_r-1 rounded-none rounded-t-xl'
>
Daftar
@@ -362,7 +370,7 @@ const NavbarDesktop = () => {
)}
{auth && (
<>
- <div href='/' className='navbar-user-dropdown-button'>
+ <div href='/' className='navbar-user-dropdown-button' aria-label='User'>
<span>Halo, {auth?.name}</span>
<div className='ml-auto'>
<ChevronDownIcon className='w-6' />
diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx
index 444ddd8e..19e76a2b 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -255,6 +255,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
>
<ImageNext
src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
+ alt='Flash Sale'
width={17}
height={10}
/>
diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx
index 113a1e42..4cfd3755 100644
--- a/src/lib/product/components/Product/ProductMobile.jsx
+++ b/src/lib/product/components/Product/ProductMobile.jsx
@@ -219,6 +219,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
>
<ImageNext
src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
+ alt='Flash Sale'
width={17}
height={10}
/>
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 2291398d..a8ed90a4 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -73,8 +73,8 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
if (variant == 'vertical') {
return (
- <div className='rounded shadow-sm border border-gray_r-4 bg-white h-[330px] md:h-[380px]' aria-label='Produk'>
- <Link href={URL.product} className='border-b border-gray_r-4 relative'>
+ <div className='rounded shadow-sm border border-gray_r-4 bg-white h-[330px] md:h-[380px]'>
+ <Link href={URL.product} className='border-b border-gray_r-4 relative' aria-label='Produk'>
<div className='relative'>
<Image
src={image}
@@ -130,6 +130,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
<div className='bg-red-600 border border-solid border-yellow-400 p-2 rounded-full h-6 flex w-fit items-center justify-center gap-x-2'>
<ImageNext
src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
+ alt='flash sale'
width={13}
height={5}
loading='eager'
@@ -305,6 +306,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
<div className='bg-red-600 rounded-full mb-1 p-2 pl-3 pr-3 flex w-fit items-center gap-x-1'>
<ImageNext
src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
+ alt='flash sae'
width={15}
height={10}
loading='eager'
diff --git a/src/lib/product/components/ProductSlider.jsx b/src/lib/product/components/ProductSlider.jsx
index 54f209cc..91d199a6 100644
--- a/src/lib/product/components/ProductSlider.jsx
+++ b/src/lib/product/components/ProductSlider.jsx
@@ -35,7 +35,7 @@ const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) =>
<>
{bannerMode && (
<SwiperSlide>
- <Link href={products.banner.url} className='w-full h-full block'></Link>
+ <Link href={products.banner.url} className='w-full h-full block' aria-label={products.banner.name}></Link>
</SwiperSlide>
)}
{products?.products?.map((product, index) => (
diff --git a/src/pages/api/hero-banner.js b/src/pages/api/hero-banner.js
index 7a348cfa..b7f3c1c5 100644
--- a/src/pages/api/hero-banner.js
+++ b/src/pages/api/hero-banner.js
@@ -28,6 +28,8 @@ export default async function handler(req, res) {
`/api/v1/banner?type=${type}`
);
+ if(!dataBannerSections) return res.status(200).json({ data: [] });
+
// Simpan hasil fetch ke Redis dengan masa kadaluarsa 3 hari (259200 detik)
await client.set(
cacheKey,