first commit
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
import React, { useState } from 'react'
|
||||
import Sidebar from './components/Sidebar.jsx'
|
||||
import Dashboard from './components/Dashboard.jsx'
|
||||
import TripTracker from './components/TripTracker.jsx'
|
||||
|
||||
/**
|
||||
* App — root layout component.
|
||||
* Implements a two-panel CSS Grid: fixed sidebar + scrollable main viewport.
|
||||
* Owns the active-page state so sidebar navigation drives content rendering.
|
||||
*/
|
||||
export default function App() {
|
||||
const [activePage, setActivePage] = useState('dashboard')
|
||||
|
||||
function renderPage() {
|
||||
switch (activePage) {
|
||||
case 'trip-tracker': return <TripTracker />
|
||||
default: return <Dashboard />
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="app-shell">
|
||||
<Sidebar activePage={activePage} onNavigate={setActivePage} />
|
||||
<main className="main-viewport">
|
||||
{renderPage()}
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user