diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-10 11:40:53 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-10 11:40:53 +0700 |
| commit | 07817bbdc1f1ae29c848e5dfdb3ac5b140f48cc4 (patch) | |
| tree | 53504690f809b0f455b7cd3961bf48e3062b5206 | |
| parent | ba9b9f01cf8ccc5bb636a55fdb5e853b2502f5a6 (diff) | |
Bug fixing cart badge, class attribute, whatsapp url
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarDesktop.jsx | 10 | ||||
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarMobile.jsx | 8 | ||||
| -rw-r--r-- | src/lib/auth/components/RegisterDesktop.jsx | 2 | ||||
| -rw-r--r-- | src/lib/auth/components/RegisterMobile.jsx | 2 | ||||
| -rw-r--r-- | src/lib/cart/components/Cart.jsx | 4 | ||||
| -rw-r--r-- | src/lib/form/components/KunjunganSales.jsx | 2 | ||||
| -rw-r--r-- | src/lib/form/components/KunjunganService.jsx | 2 | ||||
| -rw-r--r-- | src/lib/form/components/Merchant.jsx | 2 | ||||
| -rw-r--r-- | src/lib/form/components/SuratDukungan.jsx | 2 | ||||
| -rw-r--r-- | src/lib/product/components/ProductSearch.jsx | 4 |
10 files changed, 21 insertions, 17 deletions
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index 3da0035a..26edd5a4 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -73,11 +73,13 @@ const NavbarDesktop = () => { Quotation </Link> <Link href='/shop/cart' className='flex items-center gap-x-2 !text-gray_r-12/80'> - <div className='relative mr-2'> + <div className={`relative ${cartCount > 0 && 'mr-2'}`}> <ShoppingCartIcon className='w-7' /> - <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'> - {cartCount} - </span> + {cartCount > 0 && ( + <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'> + {cartCount} + </span> + )} </div> <span> Keranjang diff --git a/src/core/components/elements/Navbar/NavbarMobile.jsx b/src/core/components/elements/Navbar/NavbarMobile.jsx index 7ac967fa..b69e86e8 100644 --- a/src/core/components/elements/Navbar/NavbarMobile.jsx +++ b/src/core/components/elements/Navbar/NavbarMobile.jsx @@ -43,9 +43,11 @@ const NavbarMobile = () => { </Link> <Link href='/shop/cart' className='relative'> <ShoppingCartIcon className='w-6 text-gray_r-12' /> - <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'> - {cartCount} - </span> + {cartCount > 0 && ( + <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'> + {cartCount} + </span> + )} </Link> <button type='button' aria-label='sidebarMenuButton' onClick={open}> <Bars3Icon className='w-6 text-gray_r-12' /> diff --git a/src/lib/auth/components/RegisterDesktop.jsx b/src/lib/auth/components/RegisterDesktop.jsx index f624fba7..93b505ab 100644 --- a/src/lib/auth/components/RegisterDesktop.jsx +++ b/src/lib/auth/components/RegisterDesktop.jsx @@ -92,7 +92,7 @@ const RegisterDesktop = () => { /> </div> <ReCAPTCHA ref={recaptchaRef} sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE} /> - <div class='flex items-center mt-4 '> + <div className='flex items-center mt-4 '> <input type='checkbox' id='sdk' diff --git a/src/lib/auth/components/RegisterMobile.jsx b/src/lib/auth/components/RegisterMobile.jsx index 80ea6ab0..da6efaf5 100644 --- a/src/lib/auth/components/RegisterMobile.jsx +++ b/src/lib/auth/components/RegisterMobile.jsx @@ -96,7 +96,7 @@ const RegisterMobile = () => { /> </div> <ReCAPTCHA ref={recaptchaRef} sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE} /> - <div class='flex items-center mt-4 '> + <div className='flex items-center mt-4 '> <input type='checkbox' id='sdk' diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index 1008bffc..907d1267 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -76,7 +76,7 @@ const Cart = () => { const LoadProductSimilar = async () => { const randProductIndex = Math.floor(Math.random() * products.length) const productLoad = await productSearchApi({ - query: `q=${products?.[randProductIndex].parent.name}&limit=10` + query: `q=${products?.[randProductIndex].parent.name}&limit=10&operation=OR` }) setProductRecomendation(productLoad) @@ -474,7 +474,7 @@ const Cart = () => { </div> <div className='col-span-9 pt-2 pb-6 mt-6'> - <h1 className='text-title-sm font-semibold mb-6'>Product Yang Mungkin Kamu Suka</h1> + <h1 className='text-title-sm font-semibold mb-6'>Produk Yang Mungkin Kamu Suka</h1> <div className='grid grid-cols-5 gap-x-3 gap-y-6'> {productRecomendation && productRecomendation.response.products.map((product) => ( diff --git a/src/lib/form/components/KunjunganSales.jsx b/src/lib/form/components/KunjunganSales.jsx index 38a07345..7064f807 100644 --- a/src/lib/form/components/KunjunganSales.jsx +++ b/src/lib/form/components/KunjunganSales.jsx @@ -77,7 +77,7 @@ const KunjunganSales = () => { <div className='w-full grid grid-cols-1 md:grid-cols-2'> <form onSubmit={handleSubmit(onSubmitHandler)} className='grid grid-cols-1 gap-y-6'> <div - class='flex items-center bg-blue-100 border border-blue-300 text-blue-500 font-medium px-4 py-3 rounded leading-6' + className='flex items-center bg-blue-100 border border-blue-300 text-blue-500 font-medium px-4 py-3 rounded leading-6' role='alert' > Hubungi kami untuk mendapatkan kunjungan sales kami dan dapatkan berbagai kelebihannya diff --git a/src/lib/form/components/KunjunganService.jsx b/src/lib/form/components/KunjunganService.jsx index 076f6814..965fbc89 100644 --- a/src/lib/form/components/KunjunganService.jsx +++ b/src/lib/form/components/KunjunganService.jsx @@ -74,7 +74,7 @@ const CreateKunjunganService = () => { <h1 className='text-h-sm md:text-title-sm font-semibold mb-6'>Kunjungan Service</h1> <div className='w-full p-4 bg-white border border-gray_r-6 rounded'> <div - class='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' + className='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' role='alert' > <p> diff --git a/src/lib/form/components/Merchant.jsx b/src/lib/form/components/Merchant.jsx index 75b4e132..24b58a7c 100644 --- a/src/lib/form/components/Merchant.jsx +++ b/src/lib/form/components/Merchant.jsx @@ -103,7 +103,7 @@ const CreateMerchant = () => { <h1 className='text-h-sm md:text-title-sm font-semibold mb-6'>Form Merchant</h1> <div className='w-full p-4 bg-white border border-gray_r-6 rounded'> <div - class='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' + className='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' role='alert' > <p> diff --git a/src/lib/form/components/SuratDukungan.jsx b/src/lib/form/components/SuratDukungan.jsx index 0eab84a4..360dd838 100644 --- a/src/lib/form/components/SuratDukungan.jsx +++ b/src/lib/form/components/SuratDukungan.jsx @@ -76,7 +76,7 @@ const CreateSuratDukungan = () => { <h1 className='text-h-sm md:text-title-sm font-semibold mb-6'>Form Surat Dukungan</h1> <div className='w-full p-4 bg-white border border-gray_r-6 rounded'> <div - class='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' + className='flex items-center bg-blue-100 border border-blue-400 text-blue-500 font-bold px-4 py-3 mb-4' role='alert' > <p>Lengkapi form berikut untuk melakukan konfirmasi pembayaran.</p> diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index cc85589d..30722c82 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -248,9 +248,9 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { <span> Barang yang anda cari tidak ada?{' '} <a - href={whatsappUrl('productSearch', { + href={query?.q ? whatsappUrl('productSearch', { name: query.q - })} + }) : whatsappUrl()} className='text-danger-500' > Hubungi Kami |
