add cart no token replace auth login
This commit is contained in:
@@ -453,7 +453,14 @@ const Navbar = () => {
|
||||
<Button
|
||||
variant={'ghost'}
|
||||
className="h-10 max-lg:hidden cursor-pointer border border-slate-200"
|
||||
onClick={() => router.push('/favourite')}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
if (token) {
|
||||
router.push('/favourite');
|
||||
return;
|
||||
}
|
||||
router.push('/auth');
|
||||
}}
|
||||
aria-label="my favouurite product"
|
||||
>
|
||||
<Heart className="size-4 text-foreground" />
|
||||
@@ -461,7 +468,14 @@ const Navbar = () => {
|
||||
<Button
|
||||
variant={'ghost'}
|
||||
id="cart-icon"
|
||||
onClick={() => router.push('/cart')}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
if (token) {
|
||||
router.push('/cart');
|
||||
return;
|
||||
}
|
||||
router.push('/auth');
|
||||
}}
|
||||
className="h-10 relative max-lg:hidden cursor-pointer border border-slate-200"
|
||||
>
|
||||
<ShoppingCart className="size-4 text-foreground" />
|
||||
|
||||
Reference in New Issue
Block a user