From e028fed508d8c6bb82f3b71ece8ade5dfcbf79e7 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Wed, 29 Apr 2026 18:27:12 +0800 Subject: [PATCH] fix(mobile): add top tab switcher and remove dead settings entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar was hidden on mobile with no fallback, so users were stuck on the default view. Add a horizontal tab strip under the header for mobile viewports and drop the "后台系统设置" button which had no handler or matching view. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/App.tsx | 25 ++++++++++++++++++++++++- src/components/Sidebar.tsx | 28 ++++++++++------------------ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 20e6ce3..b4b6295 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,8 @@ import { useState } from 'react'; import { Dashboard } from './components/Dashboard'; -import { Sidebar } from './components/Sidebar'; +import { Sidebar, sidebarMenuItems } from './components/Sidebar'; import { Header } from './components/Header'; +import { cn } from './lib/utils'; export default function App() { const [currentView, setCurrentView] = useState('overall'); @@ -17,6 +18,28 @@ export default function App() {
+
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index c472769..40b823d 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import { BarChart3, Calendar, Settings, Fuel, Users, ShieldCheck } from 'lucide-react'; +import { BarChart3, Calendar, Fuel, Users } from 'lucide-react'; import { cn } from '../lib/utils'; -export function Sidebar({ currentView, setCurrentView }: { currentView: string; setCurrentView: (v: string) => void }) { - const menuItems = [ - { id: 'overall', name: '全网运营总览', icon: Calendar }, - { id: 'users', name: '司机与车辆大盘', icon: Users }, - { id: 'efficiency', name: '站点效能监控', icon: BarChart3 }, - ]; +export const sidebarMenuItems = [ + { id: 'overall', name: '全网运营总览', icon: Calendar }, + { id: 'users', name: '司机与车辆大盘', icon: Users }, + { id: 'efficiency', name: '站点效能监控', icon: BarChart3 }, +]; +export function Sidebar({ currentView, setCurrentView }: { currentView: string; setCurrentView: (v: string) => void }) { return (