Files
boc/packages/ui/src/App.tsx
T
Bernt ca43443119 Mobile: Collapsible menu closed by default
- Menu closed by default (not open)
- Toggle between ☰ (closed) and ✕ (open)
- Larger touch targets (44x44px)
- Better spacing and padding
- All pages tested and working

Tested URLs:
 / (Explorer)
 /upload (Upload)
 /console (Console)
 /health (Health API)
 /pilot (Pilot)
 /readiness (Ready)
 /kill (Kill List)
 /api/v1/missions (API)
 POST /api/v1/missions/import (Upload)
2026-07-02 17:44:32 +00:00

97 lines
4.5 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Routes, Route, Link } from 'react-router-dom';
import { useState } from 'react';
import DatasetExplorer from './pages/DatasetExplorer';
import ArtifactViewer from './pages/ArtifactViewer';
import MissionUpload from './pages/MissionUpload';
import FieldConsole from './pages/FieldConsole';
import HealthDashboard from './pages/HealthDashboard';
import PilotChecklist from './pages/PilotChecklist';
import ReadinessDashboard from './pages/ReadinessDashboard';
import KillList from './pages/KillList';
function App() {
const [developerMode, setDeveloperMode] = useState(false);
const [menuOpen, setMenuOpen] = useState(false);
return (
<div style={{ fontFamily: 'system-ui, sans-serif', maxWidth: 1200, margin: '0 auto', padding: 12 }}>
<header style={{ borderBottom: '2px solid #333', paddingBottom: 12, marginBottom: 12 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<h1 style={{ fontSize: '1.3rem', margin: 0 }}>LandveX</h1>
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
<button
onClick={() => setDeveloperMode(!developerMode)}
style={{
padding: '8px 12px',
background: developerMode ? '#ffd700' : '#f0f0f0',
border: '1px solid #ccc',
borderRadius: 4,
cursor: 'pointer',
fontSize: '0.8rem',
minWidth: 44,
minHeight: 44,
}}
>
{developerMode ? '🔓' : '🔒'}
</button>
<button
onClick={() => setMenuOpen(!menuOpen)}
style={{
padding: '8px 12px',
background: '#f0f0f0',
border: '1px solid #ccc',
borderRadius: 4,
cursor: 'pointer',
fontSize: '1rem',
minWidth: 44,
minHeight: 44,
}}
>
{menuOpen ? '✕' : '☰'}
</button>
</div>
</div>
{menuOpen && (
<nav style={{
display: 'flex',
flexDirection: 'column',
gap: 12,
marginTop: 12,
fontSize: '1rem',
padding: '12px 0',
borderTop: '1px solid #eee',
}}>
<Link to="/" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📊 Explorer</Link>
<Link to="/upload" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📤 Upload</Link>
<Link to="/console" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🎮 Console</Link>
<Link to="/health" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🏥 Health</Link>
<Link to="/pilot" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}> Pilot</Link>
<Link to="/readiness" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📋 Ready</Link>
<Link to="/kill" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🔥 Kill</Link>
{developerMode && (
<>
<Link to="/datasets" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🗂 Data</Link>
<Link to="/models" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🧠 Models</Link>
<Link to="/training" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🏋 Train</Link>
</>
)}
</nav>
)}
</header>
<Routes>
<Route path="/" element={<DatasetExplorer />} />
<Route path="/upload" element={<MissionUpload />} />
<Route path="/artifact/:id" element={<ArtifactViewer />} />
<Route path="/console" element={<FieldConsole />} />
<Route path="/health" element={<HealthDashboard />} />
<Route path="/pilot" element={<PilotChecklist />} />
<Route path="/readiness" element={<ReadinessDashboard />} />
<Route path="/kill" element={<KillList />} />
</Routes>
</div>
);
}
export default App;