refactor: Lift layout structure to App component

This commit is contained in:
2025-09-24 16:03:06 +09:00
parent df61ce27e0
commit f7c1c26f5e
2 changed files with 11 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import Topbar from './components/Topbar';
import PageContainer from './components/PageContainer';
import Sidebar from './components/Sidebar';
import { ThemeButton } from './components/ThemeButton';
@@ -6,7 +7,10 @@ const App = () => {
return (
<div className="flex h-screen">
<Sidebar />
<PageContainer />
<div className="flex flex-col flex-1">
<Topbar />
<PageContainer />
</div>
<div className="absolute bottom-4 right-4">
<ThemeButton />
</div>

View File

@@ -1,7 +1,5 @@
import { Routes, Route } from 'react-router-dom';
import Topbar from './Topbar';
import Home from './pages/Home';
import Dashboard from './pages/Dashboard';
import Todos from './pages/Todos';
@@ -9,15 +7,12 @@ import NotFound from './pages/default/NotFound';
const PageContainer = () => {
return (
<div className="flex flex-col flex-1">
<Topbar />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/todos" element={<Todos />} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/todos" element={<Todos />} />
<Route path="*" element={<NotFound />} />
</Routes>
);
};