feat(web): sync profile redesign and booking redirect

This commit is contained in:
2026-06-16 17:02:11 +01:00
parent deb51bbedb
commit 7f9b481c13
2 changed files with 9 additions and 36 deletions

View File

@@ -150,7 +150,7 @@ export default function Booking() {
if (!canSubmit) return;
const appt = await createAppointment({ shopId: shop.id, serviceId, barberId, customerId: user.id, date: `${date} ${slot}` });
if (appt) {
navigate('/perfil');
navigate('/explorar');
} else {
alert('Horário indisponível ou ocorreu um erro a comunicar com o servidor.');
}

View File

@@ -172,33 +172,10 @@ export default function Profile() {
</div>
</section>
{/* Floating Navigation Tabs */}
<div className="sticky top-4 z-40 px-2">
<div className="w-full max-w-fit mx-auto bg-white/90 backdrop-blur-2xl p-1.5 rounded-2xl sm:rounded-[2rem] border border-white/50 shadow-2xl shadow-indigo-500/5 flex items-center gap-1.5 overflow-x-auto scrollbar-hide flex-nowrap">
{[
{ id: 'favoritos', label: 'Favoritos', icon: Heart, color: 'text-rose-500' },
{ id: 'agenda', label: 'Agenda', icon: Calendar, color: 'text-indigo-500' },
{ id: 'pedidos', label: 'Pedidos', icon: ShoppingBag, color: 'text-emerald-500' },
].map((t) => (
<button
key={t.id}
onClick={() => setActiveTab(t.id as any)}
className={`flex items-center gap-2.5 px-5 py-3 rounded-xl sm:rounded-2xl whitespace-nowrap transition-all duration-500 shrink-0 ${
activeTab === t.id
? 'bg-slate-950 text-white shadow-xl scale-100'
: 'text-slate-500 hover:bg-slate-100/50 hover:text-slate-900'
}`}
>
<t.icon size={16} className={activeTab === t.id ? t.color : 'opacity-40'} fill={activeTab === t.id ? 'currentColor' : 'none'} />
<span className="text-[11px] sm:text-xs font-black uppercase tracking-widest">{t.label}</span>
</button>
))}
</div>
</div>
{/* Tab Content with Animation */}
<div className="min-h-[400px]">
{activeTab === 'favoritos' && (
{/* No Tab Bar - Vertical Layout */}
{/* Vertical Content Sections */}
<div className="space-y-24 min-h-[400px]">
{/* Section: Agenda */}
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-700">
<div className="flex items-center justify-between px-4">
<h2 className="text-xs font-black text-slate-400 uppercase tracking-[0.3em]">Cofre de Favoritos</h2>
@@ -244,10 +221,9 @@ export default function Profile() {
</div>
)}
</div>
)}
{activeTab === 'agenda' && (
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-700">
{/* Section: Favoritos */}
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-700 delay-150">
<div className="flex items-center justify-between px-4">
<h2 className="text-xs font-black text-slate-400 uppercase tracking-[0.3em]">Minha Agenda</h2>
<span className="px-2 py-1 bg-slate-100 rounded-lg text-[10px] font-black text-slate-500">{myAppointments.length} RESERVAS</span>
@@ -320,10 +296,9 @@ export default function Profile() {
</div>
)}
</div>
)}
{activeTab === 'pedidos' && (
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-700">
{/* Section: Pedidos */}
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-700 delay-300">
<div className="flex items-center justify-between px-4">
<h2 className="text-xs font-black text-slate-400 uppercase tracking-[0.3em]">Meus Pedidos</h2>
<span className="px-2 py-1 bg-slate-100 rounded-lg text-[10px] font-black text-slate-500">{myOrders.length} ITEMS</span>
@@ -373,8 +348,6 @@ export default function Profile() {
</div>
)}
</div>
)}
</div>
</div>
</>
)