-
+
-
{contacts.phone2}
+
{contacts.phone2}
-
diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx
index 929320f..ce72b2b 100644
--- a/web/src/pages/Dashboard.tsx
+++ b/web/src/pages/Dashboard.tsx
@@ -13,7 +13,7 @@ import { Tabs } from '../components/ui/tabs';
import { currency } from '../lib/format';
import { useApp } from '../context/AppContext';
import { supabase } from '../lib/supabase';
-import { Product, BarberShop } from '../types';
+import { Product, BarberShop, ShopSchedule } from '../types';
import { BarChart, Bar, CartesianGrid, ResponsiveContainer, Tooltip, XAxis } from 'recharts';
import { CalendarWeekView } from '../components/CalendarWeekView';
import {
@@ -146,6 +146,19 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
// Settings states
const [editShopName, setEditShopName] = useState(shop.name);
const [editShopAddress, setEditShopAddress] = useState(shop.address || '');
+ const [editPaymentMethods, setEditPaymentMethods] = useState(shop.paymentMethods?.join(', ') || 'Dinheiro, Cartão de Crédito, Cartão de Débito');
+ const [editSocials, setEditSocials] = useState(shop.socialNetworks || { whatsapp: '', instagram: '', facebook: '' });
+ const [editContacts, setEditContacts] = useState(shop.contacts || { phone1: '', phone2: '' });
+ const [editSchedule, setEditSchedule] = useState
(shop.schedule || [
+ { day: 'Segunda-feira', open: '09:00', close: '19:30' },
+ { day: 'Terça-feira', open: '09:00', close: '19:30' },
+ { day: 'Quarta-feira', open: '09:00', close: '19:30' },
+ { day: 'Quinta-feira', open: '09:00', close: '19:30' },
+ { day: 'Sexta-feira', open: '09:00', close: '19:30' },
+ { day: 'Sábado', open: '09:00', close: '19:00' },
+ { day: 'Domingo', open: '', close: '', closed: true },
+ ]);
+
const [isSavingSettings, setIsSavingSettings] = useState(false);
const [showSaveSuccess, setShowSaveSuccess] = useState(false);
@@ -331,6 +344,10 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
await updateShopDetails(shop.id, {
name: editShopName,
address: editShopAddress,
+ paymentMethods: editPaymentMethods.split(',').map(s => s.trim()).filter(Boolean),
+ socialNetworks: editSocials,
+ contacts: editContacts,
+ schedule: editSchedule,
});
setShowSaveSuccess(true);
setTimeout(() => setShowSaveSuccess(false), 3000);
@@ -1071,6 +1088,104 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
placeholder="Rua, Número, Código Postal, Localidade"
/>
+
+
+
+
Horário de Atendimento
+
+ {editSchedule.map((slot, idx) => (
+
+
+ {slot.day}
+
+ {!slot.closed ? (
+ <>
+
{
+ const newSchedule = [...editSchedule];
+ newSchedule[idx].open = e.target.value;
+ setEditSchedule(newSchedule);
+ }}
+ className="w-28"
+ />
+
-
+
{
+ const newSchedule = [...editSchedule];
+ newSchedule[idx].close = e.target.value;
+ setEditSchedule(newSchedule);
+ }}
+ className="w-28"
+ />
+ >
+ ) : (
+
Fechado
+ )}
+
{
+ const newSchedule = [...editSchedule];
+ newSchedule[idx].closed = !newSchedule[idx].closed;
+ setEditSchedule(newSchedule);
+ }}
+ >
+ {slot.closed ? 'Abrir' : 'Fechar'}
+
+
+ ))}
+
+
+
+
+
Formas de Pagamento
+ setEditPaymentMethods(e.target.value)}
+ placeholder="Ex: Dinheiro, Cartão de Crédito, MBWay"
+ />
+
+
) : tab === 'detalhes' ? (
-