Add initial commit
Copied from https://github.com/vsquad-gitea/pool-elo
This commit is contained in:
51
src/components/layout.rs
Normal file
51
src/components/layout.rs
Normal file
@@ -0,0 +1,51 @@
|
||||
use sycamore::prelude::*;
|
||||
|
||||
#[derive(Prop)]
|
||||
pub struct LayoutProps<'a, G: Html> {
|
||||
pub title: &'a str,
|
||||
pub children: Children<'a, G>,
|
||||
}
|
||||
|
||||
#[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,
|
||||
header {
|
||||
div (class = "flex items-center justify-between") {
|
||||
div (class = "w-full text-gray-700 md:text-center text-2xl font-semibold") {
|
||||
"Yugioh Inventory"
|
||||
}
|
||||
}
|
||||
|
||||
div (class = "container mx-auto px-6 py-3") {
|
||||
nav (class = "sm:flex sm:justify-center sm:items-center mt-4 hidden") {
|
||||
div (class = "flex flex-col sm:flex-row"){
|
||||
a(href = "add-game-form",
|
||||
class = "mt-3 text-gray-600 hover:underline sm:mx-3 sm:mt-0"
|
||||
) { "Add game result" }
|
||||
a(href = "one-v-one-board",
|
||||
class = "mt-3 text-gray-600 hover:underline sm:mx-3 sm:mt-0"
|
||||
) { "1v1 Leaderboard" }
|
||||
a(href = "overall-board",
|
||||
class = "mt-3 text-gray-600 hover:underline sm:mx-3 sm:mt-0"
|
||||
) { "Overall Leaderboard" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main(style = "my-8") {
|
||||
div(class = "container mx-auto px-6") {
|
||||
div(class = "md:flex mt-8 md:-mx-4") {
|
||||
div(class = "rounded-md overflow-hidden bg-cover bg-center") {
|
||||
(children)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
src/components/mod.rs
Normal file
1
src/components/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod layout;
|
||||
Reference in New Issue
Block a user