From 2dacece4eedc8af2ccde3be6918371293350cc4e Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sat, 26 Apr 2025 21:06:00 -0600 Subject: Convert to rocket and morgana --- src/components/layout/mod.rs | 56 ++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 20 deletions(-) (limited to 'src/components/layout/mod.rs') 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! { -
-
- Site Title -
- -
- -
-
-

Footer

-
-
+pub struct Layout { + pub children: Vec, + pub page_title: String, + pub site_title: String, +} + +impl Component for Layout { + fn render(self: Box) -> 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" + } + } + } + } + } } } + -- cgit 1.4.1