From 77d23dac7e9c527809e07b4c0e925e4321ef9304 Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Tue, 23 Dec 2025 15:58:23 -0300 Subject: [PATCH] feat(marketplace): enable ProductSearch page for pharmacy owners and employees - Add ProductSearch route at /search with access for owner, seller, employee roles - Add 'Comprar Medicamentos' button to SellerDashboard header - Add 'Comprar Medicamentos' button and card to EmployeeDashboard - Remove redirect that was blocking access to the product search page --- marketplace/src/App.tsx | 11 ++++++++- marketplace/src/pages/EmployeeDashboard.tsx | 27 +++++++++++++++------ marketplace/src/pages/SellerDashboard.tsx | 21 +++++++++++----- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/marketplace/src/App.tsx b/marketplace/src/App.tsx index 1575246..d3a5afb 100644 --- a/marketplace/src/App.tsx +++ b/marketplace/src/App.tsx @@ -9,6 +9,7 @@ import { SellerDashboardPage } from './pages/SellerDashboard' import { EmployeeDashboardPage } from './pages/EmployeeDashboard' import { DeliveryDashboardPage } from './pages/DeliveryDashboard' import { MyProfilePage } from './pages/MyProfile' +import ProductSearch from './pages/ProductSearch' import { ProtectedRoute } from './components/ProtectedRoute' import { DashboardLayout } from './layouts/DashboardLayout' import { @@ -143,7 +144,15 @@ function App() { } /> - } /> + {/* Product Search - Buy from other pharmacies */} + + + + } + /> } /> ) diff --git a/marketplace/src/pages/EmployeeDashboard.tsx b/marketplace/src/pages/EmployeeDashboard.tsx index 5822e7d..8fb72c9 100644 --- a/marketplace/src/pages/EmployeeDashboard.tsx +++ b/marketplace/src/pages/EmployeeDashboard.tsx @@ -1,4 +1,5 @@ import { useAuth } from '../context/AuthContext' +import { Link } from 'react-router-dom' export function EmployeeDashboardPage() { const { user, logout } = useAuth() @@ -11,15 +12,27 @@ export function EmployeeDashboardPage() {

Painel do Colaborador

Bem-vindo, {user?.name}

- +
+ + 🛒 Comprar Medicamentos + + +
-
+
+ +

🛒 Comprar Medicamentos

+

Encontrar medicamentos próximos à venda.

+

Pedidos

Gerenciar pedidos recebidos.

diff --git a/marketplace/src/pages/SellerDashboard.tsx b/marketplace/src/pages/SellerDashboard.tsx index 18b438c..e5f8a16 100644 --- a/marketplace/src/pages/SellerDashboard.tsx +++ b/marketplace/src/pages/SellerDashboard.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react' +import { Link } from 'react-router-dom' import { Shell } from '../layouts/Shell' import { apiClient } from '../services/apiClient' import { formatCents } from '../utils/format' @@ -59,12 +60,20 @@ export function SellerDashboardPage() {

Dashboard do Vendedor

Métricas e indicadores de performance

- +
+ + 🛒 Comprar Medicamentos + + +
{loading && (