notwork - login form capsule with rcsignal
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::components::layout::Layout;
|
||||
use crate::{components::layout::Layout, state_enums::GameState};
|
||||
use perseus::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sycamore::prelude::*;
|
||||
@@ -40,7 +40,7 @@ fn add_game_form_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a PageStat
|
||||
};
|
||||
|
||||
view! { cx,
|
||||
Layout(_title = "Add Game Results") {
|
||||
Layout(title = "Add Game Results", game = GameState::Pool) {
|
||||
div (class = "flex flex-wrap") {
|
||||
select {
|
||||
option (value="red")
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
use perseus::{prelude::*, state::GlobalStateCreator};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::state_enums::LoginState;
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(engine)] {
|
||||
|
||||
@@ -16,13 +18,6 @@ pub struct AppState {
|
||||
pub auth: AuthData,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub enum LoginState {
|
||||
Authenticated,
|
||||
NotAuthenticated,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ReactiveState, Clone)]
|
||||
#[rx(alias = "AuthDataRx")]
|
||||
pub struct AuthData {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use crate::components::layout::Layout;
|
||||
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(_title = "Index") {
|
||||
Layout(title = "Index", game = GameState::Pool) {
|
||||
// Anything we put in here will be rendered inside the `<main>` block of the layout
|
||||
p { "Hello World!" }
|
||||
br {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::components::layout::Layout;
|
||||
use crate::{components::layout::Layout, state_enums::GameState};
|
||||
use perseus::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sycamore::prelude::*;
|
||||
@@ -9,7 +9,7 @@ struct PageState {}
|
||||
|
||||
fn one_v_one_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
|
||||
view! { cx,
|
||||
Layout(_title = "1v1 Leaderboard") {
|
||||
Layout(title = "1v1 Leaderboard", game = GameState::Pool) {
|
||||
p { "leaderboard" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use crate::{components::layout::Layout, templates::global_state::AppStateRx};
|
||||
use crate::{
|
||||
components::layout::Layout, state_enums::GameState, templates::global_state::AppStateRx,
|
||||
};
|
||||
|
||||
use perseus::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -12,7 +14,7 @@ fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageSta
|
||||
let _global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
|
||||
|
||||
view! { cx,
|
||||
Layout(_title = "Overall Leaderboard") {
|
||||
Layout(title = "Overall Leaderboard", game = GameState::Pool) {
|
||||
ul {
|
||||
(View::new_fragment(
|
||||
vec![],
|
||||
|
||||
Reference in New Issue
Block a user