Add initial website
Some checks failed
Build Crate / build (push) Failing after 7m23s

This commit is contained in:
2023-09-17 23:25:46 -04:00
parent d640899c80
commit 90c1f58607
16 changed files with 492 additions and 2 deletions

30
src/components/layout.rs Normal file
View File

@@ -0,0 +1,30 @@
use sycamore::prelude::*;
#[component]
pub fn Layout<'a, G: Html>(
cx: Scope<'a>,
LayoutProps { title, children }: LayoutProps<'a, G>,
) -> View<G> {
let children = children.call(cx);
view! { cx,
// These elements are styled with bright colors for demonstration purposes
header(style = "background-color: red; color: white; padding: 1rem") {
p { (title.to_string()) }
}
main(style = "padding: 1rem") {
(children)
}
footer(style = "background-color: black; color: white; padding: 1rem") {
p { "Hey there, I'm a footer!" }
}
}
}
#[derive(Prop)]
pub struct LayoutProps<'a, G: Html> {
/// The title of the page, which will be displayed in the header.
pub title: &'a str,
/// The content to put inside the layout.
pub children: Children<'a, G>,
}

1
src/components/mod.rs Normal file
View File

@@ -0,0 +1 @@
pub mod layout;