diff --git a/client/src/components/auth.rs b/client/src/components/auth.rs index bcf619c..29d2289 100644 --- a/client/src/components/auth.rs +++ b/client/src/components/auth.rs @@ -47,26 +47,28 @@ pub fn Auth() -> impl IntoView { view! {

Sign in:

-

- "You were already given a random name but if you'd like to change it this is the place. Identities are saved once created so if you leave or get disconnected just enter your old name here to \"log back in\". Please don't steal each other's identities (yes, you can)." -

-
-

Username:

-
- + "Disconnected."

}> +

+ "You were already given a random name but if you'd like to change it this is the place. Identities are saved once created so if you leave or get disconnected just enter your old name here to \"log back in\". Please don't steal each other's identities (yes, you can)." +


- - +

Username:

+
+ +
+ +
+
} } diff --git a/client/src/components/browser.rs b/client/src/components/browser.rs index b365204..ae33049 100644 --- a/client/src/components/browser.rs +++ b/client/src/components/browser.rs @@ -1,5 +1,6 @@ use crate::components::websocket::WebSocketContext; use leptos::*; +use leptos_use::core::ConnectionReadyState; use lib::*; use serde_json::to_string; @@ -7,6 +8,8 @@ use serde_json::to_string; pub fn Browser() -> impl IntoView { // Websocket stuff let websocket = expect_context::(); + let connected = move || websocket.ready_state.get() == ConnectionReadyState::Open; + let tx = websocket.clone(); let (websocket_send, set_websocket_send) = create_signal("".to_string()); @@ -37,62 +40,66 @@ pub fn Browser() -> impl IntoView { view! {

Game Browser

-

"Yes, the delete button works. Please don't abuse it."

- 0 } - fallback=|| view! { "No games to show right now.. Maybe you should create one!" } - > -
- - - - - - - - - - - - - - - - - + "Disconnected."

}> + 0 } + fallback=|| { + view! { "No games to show right now.. Maybe you should create one!" } + } + > +

"Yes, the delete button works. Please don't abuse it."

+
+
NameHostPlayersCard Packs
{&game.name}{&game.host} - {&game.players.to_string()} - - {&game.packs.len().to_string()} - - - -
+ + + + + + + + + + + + + + + + + } } - } - /> -
NameHostPlayersCard Packs
{&game.name}{&game.host} + {&game.players.to_string()} + + {&game.packs.len().to_string()} + + + +
-
+ /> + +
+ } diff --git a/client/src/components/create_game.rs b/client/src/components/create_game.rs index 0818023..df48ec5 100644 --- a/client/src/components/create_game.rs +++ b/client/src/components/create_game.rs @@ -62,10 +62,10 @@ pub fn CreateGame() -> impl IntoView { view! {
- Disconnected.

}> +

Create Game

+ "Disconnected."

}>
-

Create Game

impl IntoView { view! {

Game

- -
- + "Disconnected."

}> + +
+ - // Judging view // + // Judging view // - -
- + +
+ + + // Selected cards + } + } + /> +
+ + // Submit button +
+ +
- // Selected cards } - } - /> -
- - // Submit button -
- -
- - - - -
- } - } - /> -
- } - } - /> - - - // Playing view // - - - - // Play cards -
- - - // Selected cards - } - } - /> -
- - // Submit button -
- -
- - // Player hand -
- + + + + } } - } - }> - - + /> +
} } /> -
+
+ + // Playing view // + + + + // Play cards +
+ + + // Selected cards + } + } + /> +
+ + // Submit button +
+ +
+ + // Player hand +
+ + + + } + } + /> +
+