+
+ {shop.imageUrl ? (
+
+ ) : (
+
{initials}
+ )}
+
+ {/* Rating pill */}
+
+
+
+ {shop.rating ? shop.rating.toFixed(1) : '—'}
+
- )}
- {/* Gradient overlay */}
-
-
- {/* Rating badge */}
-
-
-
- {shop.rating ? shop.rating.toFixed(1) : '—'}
-
- {/* Favorite button */}
-
{ e.preventDefault(); toggleFavorite(shop.id); }}
- className={`absolute top-3 right-3 p-1.5 rounded-full backdrop-blur-sm transition-all ${favorite
- ? 'bg-rose-500 text-white shadow-md scale-110'
- : 'bg-black/40 text-white hover:bg-rose-500'
- }`}
- >
-
-
+ {/* Info */}
+
+
+
+ {shop.name}
+
+ {/* Favorite */}
+ { e.preventDefault(); toggleFavorite(shop.id); }}
+ className={`flex-shrink-0 p-1 rounded-full transition-all ${favorite ? 'text-rose-500 bg-rose-50' : 'text-slate-300 hover:text-rose-400 hover:bg-rose-50'
+ }`}
+ >
+
+
+
- {/* Shop name on image */}
-
-
- {shop.name}
-
+
+
+
{shop.address || 'Endereço não disponível'}
+
+
+
+
+
+ {(shop.services || []).length} serviços
+
+
+
+ {(shop.barbers || []).length} barbeiros
+
+
- {/* Info section */}
-
-
-
-
{shop.address || 'Endereço não disponível'}
-
+ {/* Separator */}
+
-
-
-
- {(shop.services || []).length} serviços
-
- •
- {(shop.barbers || []).length} barbeiros
-
-
- {/* Action buttons */}
-
-
- Ver detalhes
-
-
-
- Agendar
-
-
+ {/* Actions */}
+
+
+ Ver detalhes
+
+
+
+ Agendar
+
);
diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx
index bb72084..ace7f3b 100644
--- a/web/src/pages/Explore.tsx
+++ b/web/src/pages/Explore.tsx
@@ -4,17 +4,15 @@
import { useMemo, useState } from 'react';
import { ShopCard } from '../components/ShopCard';
import { useApp } from '../context/AppContext';
-import { Search, Heart, Compass, SlidersHorizontal } from 'lucide-react';
+import { Search, Heart, Scissors, SlidersHorizontal, X } from 'lucide-react';
export default function Explore() {
const { shops, favorites } = useApp();
const [query, setQuery] = useState('');
- const [filter, setFilter] = useState<'todas' | 'top' | 'produtos' | 'barbeiros' | 'favoritas'>('todas');
+ const [filter, setFilter] = useState<'todas' | 'top' | 'produtos' | 'favoritas'>('todas');
const [sortBy, setSortBy] = useState<'relevancia' | 'avaliacao' | 'preco' | 'servicos'>('relevancia');
- const favoriteShops = useMemo(() => shops.filter((s) => favorites.includes(s.id)), [shops, favorites]);
-
const filtered = useMemo(() => {
const normalized = query.trim().toLowerCase();
const matchesQuery = (name: string, address: string) =>
@@ -24,7 +22,6 @@ export default function Explore() {
if (filter === 'favoritas') return favorites.includes(shop.id);
if (filter === 'top') return (shop.rating || 0) >= 4;
if (filter === 'produtos') return (shop.products || []).length > 0;
- if (filter === 'barbeiros') return (shop.barbers || []).length >= 2;
return true;
};
@@ -44,100 +41,88 @@ export default function Explore() {
});
}, [shops, query, filter, sortBy, favorites]);
- const chips: { id: typeof filter; label: string; icon?: React.ReactNode }[] = [
+ const chips: { id: typeof filter; label: string }[] = [
{ id: 'todas', label: 'Todas' },
- { id: 'favoritas', label: `Favoritas${favorites.length > 0 ? ` (${favorites.length})` : ''}`, icon:
},
- { id: 'top', label: 'Top avaliadas' },
- { id: 'produtos', label: 'Com produtos' },
- { id: 'barbeiros', label: 'Mais barbeiros' },
+ { id: 'favoritas', label: `❤️ Favoritas${favorites.length > 0 ? ` (${favorites.length})` : ''}` },
+ { id: 'top', label: '⭐ Top avaliadas' },
+ { id: 'produtos', label: '🛍️ Com produtos' },
];
return (
-
- {/* Hero Header */}
-
-
-
-
-
-
Explorar
+
+ {/* Page header */}
+
+
+
+
+ Explorar
-
Barbearias
-
Encontre a sua favorita e agende em minutos.
+
Barbearias
+
+ {filtered.length} {filtered.length === 1 ? 'resultado' : 'resultados'}
+
- {/* Search & Sort bar */}
-
-
-
-
- setQuery(e.target.value)}
- placeholder="Pesquisar por nome ou endereço..."
- className="w-full pl-10 pr-4 py-2.5 rounded-xl border border-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent placeholder:text-slate-400"
- />
-
-
-
- setSortBy(e.target.value as typeof sortBy)}
- className="border border-slate-200 rounded-xl px-3 py-2.5 text-sm text-slate-700 focus:outline-none focus:ring-2 focus:ring-amber-400 bg-white"
- >
- Relevância
- Melhor avaliação
- Menor preço
- Mais serviços
-
-
-
-
- {/* Filter chips */}
-
- {chips.map((chip) => (
- setFilter(chip.id)}
- className={`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-semibold transition-all ${filter === chip.id
- ? chip.id === 'favoritas'
- ? 'bg-rose-500 text-white shadow-sm'
- : 'bg-amber-500 text-white shadow-sm'
- : 'bg-slate-100 text-slate-600 hover:bg-slate-200'
- }`}
- >
- {chip.icon}
- {chip.label}
-
- ))}
-
+ {/* Search bar */}
+
+
+ setQuery(e.target.value)}
+ placeholder="Pesquisar por nome ou endereço..."
+ className="w-full pl-10 pr-10 py-3 rounded-2xl border border-slate-200 bg-white text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent placeholder:text-slate-400 shadow-sm"
+ />
+ {query && (
+ setQuery('')} className="absolute right-3.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600">
+
+
+ )}
- {/* Results count */}
-
-
- {filtered.length} {' '}
- {filtered.length === 1 ? 'barbearia encontrada' : 'barbearias encontradas'}
-
+ {/* Filters row */}
+
+ {chips.map((chip) => (
+
setFilter(chip.id)}
+ className={`px-4 py-2 rounded-full text-xs font-semibold transition-all ${filter === chip.id
+ ? 'bg-amber-500 text-white shadow-sm'
+ : 'bg-white text-slate-600 border border-slate-200 hover:border-amber-300 hover:text-amber-700'
+ }`}
+ >
+ {chip.label}
+
+ ))}
+
+
+
+ setSortBy(e.target.value as typeof sortBy)}
+ className="border border-slate-200 rounded-xl px-3 py-2 text-xs font-medium text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-amber-400"
+ >
+ Relevância
+ Melhor avaliação
+ Menor preço
+ Mais serviços
+
+
{/* Grid */}
{filtered.length === 0 ? (
- {filter === 'favoritas'
- ?
- :
- }
+ {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.'}
+ ? 'Clique no ❤️ de qualquer barbearia para guardar aqui.'
+ : 'Tente ajustar os filtros ou a pesquisa.'}
) : (