diff options
Diffstat (limited to 'src/components/layout')
-rw-r--r-- | src/components/layout/mod.rs | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/src/components/layout/mod.rs b/src/components/layout/mod.rs index e688f5f..cc524e9 100644 --- a/src/components/layout/mod.rs +++ b/src/components/layout/mod.rs @@ -1,25 +1,41 @@ -use leptos::prelude::*; -use leptos::component; -use leptos_router::components::Outlet; +use morgana::{morx, Component, RenderNode}; stylance::import_crate_style!(styles, "src/components/layout/layout.module.css"); -#[component] -pub fn Layout() -> impl IntoView { - view! { - <div class=styles::layout> - <header> - <a href="/" id="siteTitle">Site Title</a> - </header> - <nav> - <p>Nav</p> - </nav> - <main> - <Outlet/> - </main> - <footer> - <p>Footer</p> - </footer> - </div> +pub struct Layout { + pub children: Vec<RenderNode>, + pub page_title: String, + pub site_title: String, +} + +impl Component for Layout { + fn render(self: Box<Self>) -> RenderNode { + morx! { + html lang="html" { + head { + title ={self.page_title} + } + body { + div class={styles::layout} { + header { + a href="/" id="siteTitle" { + ={self.site_title} + } + } + + nav { + p= "Nav" + } + + main ={self.children} + + footer { + p= "Footer" + } + } + } + } + } } } + |