mirror of
https://github.com/ershisan99/podcaster.git
synced 2025-12-17 05:09:27 +00:00
wip: add layout component and wrap the app
This commit is contained in:
14
src/components/layout.tsx
Normal file
14
src/components/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { Outlet } from "react-router-dom";
|
||||||
|
|
||||||
|
export function Layout() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<header>
|
||||||
|
<h1>Header</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<Outlet />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -3,8 +3,12 @@ import { Home } from "./pages/home";
|
|||||||
import { Podcast } from "./pages/podcast";
|
import { Podcast } from "./pages/podcast";
|
||||||
import { Episode } from "./pages/episode";
|
import { Episode } from "./pages/episode";
|
||||||
import { PodcastEpisodesList } from "./components/podcast-episodes-list";
|
import { PodcastEpisodesList } from "./components/podcast-episodes-list";
|
||||||
|
import { Layout } from "./components/layout";
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter([
|
||||||
|
{
|
||||||
|
element: <Layout />,
|
||||||
|
children: [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <Home />,
|
element: <Home />,
|
||||||
@@ -23,6 +27,8 @@ const router = createBrowserRouter([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function Router() {
|
export function Router() {
|
||||||
|
|||||||
Reference in New Issue
Block a user