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 /src/core | |
| parent | ba9b9f01cf8ccc5bb636a55fdb5e853b2502f5a6 (diff) | |
Bug fixing cart badge, class attribute, whatsapp url
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarDesktop.jsx | 10 | ||||
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarMobile.jsx | 8 |
2 files changed, 11 insertions, 7 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' /> |
