From a405bfb91f2f9fc2a19da2f623fa2cde41f9f97c Mon Sep 17 00:00:00 2001 From: MarcWieland Date: Mon, 27 Jul 2026 00:11:10 +0200 Subject: [PATCH] Add responsive mobile layout and drawer menu --- src/App.tsx | 26 ++++- src/components/LiveOrdersTable.tsx | 56 +++++----- src/components/Sidebar.tsx | 91 ++++++++++----- src/index.css | 173 ++++++++++++++++++++++++++++- src/views/DispatchingView.tsx | 66 +++++------ src/views/InventoryView.tsx | 72 ++++++------ src/views/TimeTrackingView.tsx | 61 +++++----- 7 files changed, 389 insertions(+), 156 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d91cade..4a83a64 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { Menu, Wrench } from 'lucide-react'; import { Sidebar } from './components/Sidebar'; import { DashboardView } from './views/DashboardView'; import { DispatchingView } from './views/DispatchingView'; @@ -9,6 +10,7 @@ import { SupabaseSyncView } from './views/SupabaseSyncView'; export const App: React.FC = () => { const [activeTab, setActiveTab] = useState('dashboard'); + const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const renderView = () => { switch (activeTab) { @@ -31,7 +33,29 @@ export const App: React.FC = () => { return (
- + {/* Mobile Header Bar */} +
+ + +
+ + Handwerksfreund +
+
+ + setMobileMenuOpen(false)} + /> +
{renderView()}
diff --git a/src/components/LiveOrdersTable.tsx b/src/components/LiveOrdersTable.tsx index 88c8d87..0675343 100644 --- a/src/components/LiveOrdersTable.tsx +++ b/src/components/LiveOrdersTable.tsx @@ -9,34 +9,36 @@ export const LiveOrdersTable: React.FC = ({ orders }) => { return (

Heutige Live-Aufträge (Dispatching)

- - - - - - - - - - {orders.map((order) => ( - - - - +
+
KundeMonteurStatus
{order.customerName}{order.technicianName} - - {order.status === 'Geplant' ? `Geplant (${order.startTime})` : order.status} - -
+ + + + + - ))} - -
KundeMonteurStatus
+ + + {orders.map((order) => ( + + {order.customerName} + {order.technicianName} + + + {order.status === 'Geplant' ? `Geplant (${order.startTime})` : order.status} + + + + ))} + + +
); }; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index e810515..aba3ab1 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -6,15 +6,23 @@ import { Package, Users, Clock, - Database + Database, + X } from 'lucide-react'; interface SidebarProps { activeTab: string; setActiveTab: (tab: string) => void; + isOpen: boolean; + onClose: () => void; } -export const Sidebar: React.FC = ({ activeTab, setActiveTab }) => { +export const Sidebar: React.FC = ({ + activeTab, + setActiveTab, + isOpen, + onClose +}) => { const menuItems = [ { id: 'dashboard', label: 'Dashboard', icon: LayoutDashboard }, { id: 'dispatching', label: 'Dispatching', icon: CalendarDays }, @@ -24,33 +32,58 @@ export const Sidebar: React.FC = ({ activeTab, setActiveTab }) => { id: 'supabase', label: 'Supabase Sync', icon: Database }, ]; - return ( - + return ( + <> + {/* Mobile Backdrop */} + {isOpen && ( + ); diff --git a/src/views/TimeTrackingView.tsx b/src/views/TimeTrackingView.tsx index faf7277..af8bd9b 100644 --- a/src/views/TimeTrackingView.tsx +++ b/src/views/TimeTrackingView.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { Clock, CheckCircle } from 'lucide-react'; export const TimeTrackingView: React.FC = () => { const timeEntries = [ @@ -18,36 +17,38 @@ export const TimeTrackingView: React.FC = () => {

Erfasste Arbeitszeiten der Monteure

- - - - - - - - - - - - - {timeEntries.map((e, idx) => ( - - - - - - - +
+
DatumMonteurKunde / ProjektTätigkeitDauerStatus
{e.date}{e.technician}{e.customer}{e.activity}{e.hours} - - {e.status} - -
+ + + + + + + + - ))} - -
DatumMonteurKunde / ProjektTätigkeitDauerStatus
+ + + {timeEntries.map((e, idx) => ( + + {e.date} + {e.technician} + {e.customer} + {e.activity} + {e.hours} + + + {e.status} + + + + ))} + + +
);