Mode templates to folders
Some checks failed
Build Crate / build (push) Failing after 1m46s

This commit is contained in:
2024-08-29 16:28:05 -04:00
parent 988d0f9807
commit d25fb283cc
11 changed files with 22 additions and 77 deletions

View File

@@ -0,0 +1,24 @@
use crate::{components::layout::Layout, state_enums::GameState};
use perseus::prelude::*;
use sycamore::prelude::*;
fn index_page<G: Html>(cx: Scope) -> View<G> {
view! { cx,
Layout(game = GameState::Pool) {
// Anything we put in here will be rendered inside the `<main>` block of the layout
p { "Hello World!" }
br {}
}
}
}
#[engine_only_fn]
fn head(cx: Scope) -> View<SsrNode> {
view! { cx,
title { "Index Page" }
}
}
pub fn get_template<G: Html>() -> Template<G> {
Template::build("").view(index_page).head(head).build()
}