Add base data structures for pool matches
Some checks failed
Build Crate / build (push) Failing after 4m29s

This commit is contained in:
2023-09-22 03:45:48 -04:00
parent 0a68829d6c
commit 30f3aa63d5
16 changed files with 148 additions and 123 deletions

View File

@@ -1,23 +1,18 @@
use crate::components::layout::Layout;
use crate::{components::layout::Layout, templates::global_state::AppStateRx};
use perseus::prelude::*;
use serde::{Deserialize, Serialize};
use sycamore::prelude::*;
use crate::templates::global_state::AppStateRx;
// Reactive page
#[derive(Serialize, Deserialize, Clone, ReactiveState)]
#[rx(alias = "PageStateRx")]
struct PageState {
}
struct PageState {}
fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
let global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
view! { cx,
Layout(title = "Overall Leaderboard") {
// Anything we put in here will be rendered inside the `<main>` block of the layout
ul {
(View::new_fragment(
global_state.matches.get()
@@ -29,7 +24,7 @@ fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageSta
let game = item.clone();
view! { cx,
li {
(game.winner)
(game.id)
}
}
})
@@ -55,9 +50,6 @@ fn head(cx: Scope) -> View<SsrNode> {
}
}
// Template
pub fn get_template<G: Html>() -> Template<G> {
Template::build("overall-board")
.request_state_fn(get_request_state)