summary refs log tree commit diff
path: root/src/components/layout/mod.rs
diff options
context:
space:
mode:
authorAshelyn Rose <git@ashen.earth>2025-04-26 21:06:00 -0600
committerAshelyn Rose <git@ashen.earth>2025-04-26 21:06:00 -0600
commit2dacece4eedc8af2ccde3be6918371293350cc4e (patch)
tree81364da50cad615cd387f38d1abcc62102939033 /src/components/layout/mod.rs
parent619373a261ad18c51cd09bc61d116f585c8295ec (diff)
Convert to rocket and morgana no-leptos
Diffstat (limited to 'src/components/layout/mod.rs')
-rw-r--r--src/components/layout/mod.rs56
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"
+                        }
+                    }
+                }
+            }
+        }
     }
 }
+