From cad60109653ed9b4b775631126f34d38cd9d273e Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Tue, 23 Dec 2025 16:01:54 -0300 Subject: [PATCH] feat(marketplace): replace cart text with icon + badge counter - Remove Checkout link from header navigation - Replace 'Carrinho' text with cart SVG icon - Add red badge showing cart item count (max 99+) - Import and use cartStore for real-time count updates --- marketplace/src/layouts/Shell.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/marketplace/src/layouts/Shell.tsx b/marketplace/src/layouts/Shell.tsx index d8ec97f..d7accf3 100644 --- a/marketplace/src/layouts/Shell.tsx +++ b/marketplace/src/layouts/Shell.tsx @@ -1,11 +1,13 @@ import { useEffect, useRef, useState } from 'react' import { Link } from 'react-router-dom' import { useAuth } from '../context/AuthContext' +import { useCartStore, selectCartSummary } from '../stores/cartStore' export function Shell({ children }: { children: React.ReactNode }) { const { user, logout } = useAuth() const [isProfileOpen, setIsProfileOpen] = useState(false) const profileMenuRef = useRef(null) + const { totalItems: cartCount } = useCartStore(selectCartSummary) const isOwner = user?.role === 'owner' || user?.role === 'seller' const isAdmin = user?.role === 'admin' @@ -56,11 +58,15 @@ export function Shell({ children }: { children: React.ReactNode }) { )} - - Carrinho - - - Checkout + + + + + {cartCount > 0 && ( + + {cartCount > 99 ? '99+' : cartCount} + + )} {user && (