diff --git a/web/src/components/ShopCard.tsx b/web/src/components/ShopCard.tsx index fd399e6..3b63d67 100644 --- a/web/src/components/ShopCard.tsx +++ b/web/src/components/ShopCard.tsx @@ -1,62 +1,91 @@ import { Link } from 'react-router-dom'; -import { Star, MapPin, Scissors } from 'lucide-react'; +import { Star, MapPin, Scissors, Heart, Calendar } from 'lucide-react'; import { BarberShop } from '../types'; -import { Card } from './ui/card'; -import { Button } from './ui/button'; +import { useApp } from '../context/AppContext'; + +export const ShopCard = ({ shop, compact = false }: { shop: BarberShop; compact?: boolean }) => { + const { toggleFavorite, isFavorite } = useApp(); + const favorite = isFavorite(shop.id); -export const ShopCard = ({ shop }: { shop: BarberShop }) => { return ( - -
- {/* Avatar Circular com Badge de Rating */} -
-
- {shop.imageUrl ? ( - {shop.name} - ) : ( -
- -
- )} -
- {/* Rating Badge - Posicionado em cima à direita como na imagem base */} -
- - - {shop.rating ? shop.rating.toFixed(1) : '0.0'} - +
+ {/* Cover image */} +
+ {shop.imageUrl ? ( + {shop.name} + ) : ( +
+ +

Sem foto de capa

+ )} + {/* Gradient overlay */} +
+ + {/* Rating badge */} +
+ + + {shop.rating ? shop.rating.toFixed(1) : '—'} +
- {/* Informações da Barbearia */} -
-

+ {/* Favorite button */} + + + {/* Shop name on image */} +
+

{shop.name}

-
- -

- {shop.address || 'Endereço Indisponível'} -

-
- -
- {(shop.services || []).length} serviços - - {(shop.barbers || []).length} barbeiros -

- {/* Botões de Ação na base */} -
- - + {/* Info section */} +
+
+ +

{shop.address || 'Endereço não disponível'}

+
+ +
+ + + {(shop.services || []).length} serviços + + + {(shop.barbers || []).length} barbeiros +
+ + {/* Action buttons */} +
+ + Ver detalhes + + + + Agendar + +
- +
); }; diff --git a/web/src/components/layout/Header.tsx b/web/src/components/layout/Header.tsx index 1af1baa..5e2f832 100644 --- a/web/src/components/layout/Header.tsx +++ b/web/src/components/layout/Header.tsx @@ -1,11 +1,12 @@ -import { Link, useNavigate } from 'react-router-dom' -import { MapPin, ShoppingCart, User, LogOut, Menu, X } from 'lucide-react' +import { Link, useNavigate, useLocation } from 'react-router-dom' +import { ShoppingCart, User, LogOut, Menu, X, Scissors, Search } from 'lucide-react' import { useApp } from '../../context/AppContext' import { useState } from 'react' export const Header = () => { const { user, cart, logout } = useApp() const navigate = useNavigate() + const location = useLocation() const [mobileMenuOpen, setMobileMenuOpen] = useState(false) const handleLogout = () => { @@ -14,36 +15,46 @@ export const Header = () => { setMobileMenuOpen(false) } + const navLink = (to: string) => + `flex items-center gap-1.5 text-sm font-medium transition-colors px-3 py-1.5 rounded-lg ${location.pathname === to + ? 'bg-amber-50 text-amber-700' + : 'text-slate-600 hover:text-amber-700 hover:bg-amber-50' + }` + return ( -
-
+
+
+ {/* Logo */} setMobileMenuOpen(false)} + className="flex items-center gap-2 group" > - Smart Agenda +
+ +
+ SmartAgenda {/* Desktop Navigation */} -
{/* Mobile Menu */} {mobileMenuOpen && ( -
-
+ {/* Results count */} +
+

+ {filtered.length}{' '} + {filtered.length === 1 ? 'barbearia encontrada' : 'barbearias encontradas'} +

+
+ + {/* Grid */} {filtered.length === 0 ? ( - -

Nenhuma barbearia encontrada

-

Tente ajustar a pesquisa ou limpar os filtros.

-
+
+
+ {filter === 'favoritas' + ? + : + } +
+

+ {filter === 'favoritas' ? 'Ainda não tem favoritas' : 'Nenhuma barbearia encontrada'} +

+

+ {filter === 'favoritas' + ? 'Clique no ❤️ em qualquer barbearia para a guardar aqui.' + : 'Tente ajustar a pesquisa ou os filtros.'} +

+
) : ( -
+
{filtered.map((shop) => ( ))} @@ -132,5 +150,3 @@ export default function Explore() {
); } - - diff --git a/web/src/pages/Profile.tsx b/web/src/pages/Profile.tsx index e12b0d7..6613fcb 100644 --- a/web/src/pages/Profile.tsx +++ b/web/src/pages/Profile.tsx @@ -10,7 +10,7 @@ import { Badge } from '../components/ui/badge' import { Button } from '../components/ui/button' import { currency } from '../lib/format' import { useApp } from '../context/AppContext' -import { Calendar, ShoppingBag, User, Clock, Heart, Star, MapPin } from 'lucide-react' +import { Calendar, ShoppingBag, User, Clock, Heart, Star } from 'lucide-react' import { supabase } from '../lib/supabase' import { ReviewModal } from '../components/ReviewModal' @@ -29,7 +29,7 @@ const statusLabel: Record = { } export default function Profile() { - const { appointments, orders, shops, favorites, submitReview } = useApp() + const { appointments, orders, shops, submitReview } = useApp() const navigate = useNavigate() const [authEmail, setAuthEmail] = useState('') @@ -75,9 +75,6 @@ export default function Profile() { return orders.filter((o) => o.customerId === authId) }, [orders, authId]) - const favoriteShops = useMemo(() => { - return shops.filter((s) => favorites.includes(s.id)) - }, [shops, favorites]) const handleReviewSubmit = async (rating: number, comment: string) => { if (!reviewTarget) return @@ -142,56 +139,11 @@ export default function Profile() {

{authEmail}

Cliente - {favoriteShops.length > 0 && ( - - {favoriteShops.length} favorita{favoriteShops.length > 1 ? 's' : ''} - - )}
- {/* ❤️ Barbearias Favoritas */} - {favoriteShops.length > 0 && ( -
-
- -

Barbearias Favoritas

- {favoriteShops.length} -
-
- {favoriteShops.map((shop) => ( - - - {shop.imageUrl ? ( - {shop.name} - ) : ( -
- -
- )} -
-

{shop.name}

- {shop.address && ( -

- {shop.address} -

- )} - {shop.rating > 0 && ( -

- - {shop.rating.toFixed(1)} -

- )} -
-
- - ))} -
-
- )} - {/* Agendamentos */}