diff --git a/client/src/components/auth.rs b/client/src/components/auth.rs
index f9f8563..5efcba3 100644
--- a/client/src/components/auth.rs
+++ b/client/src/components/auth.rs
@@ -35,22 +35,19 @@ pub fn Auth() -> impl IntoView {
}
}
diff --git a/client/src/components/browser.rs b/client/src/components/browser.rs
new file mode 100644
index 0000000..a20fc9a
--- /dev/null
+++ b/client/src/components/browser.rs
@@ -0,0 +1,39 @@
+use crate::components::websocket::WebSocketContext;
+use leptos::*;
+use leptos_use::core::ConnectionReadyState;
+use lib::models::GamesUpdate;
+
+#[component]
+pub fn Browser() -> impl IntoView {
+ let websocket = expect_context::();
+ let game_update_context = expect_context::>>();
+
+ let (active_games, set_active_games) = create_signal::>(vec![]);
+
+ create_effect(move |_| {
+ game_update_context.with(move |games| {
+ if let Some(games) = games {
+ set_active_games(games.games.clone());
+ logging::log!("{:#?}",active_games());
+ }
+ })
+ });
+
+ // Clear games list on disconnect
+ create_effect(move |_| {
+ websocket.ready_state.with(move |status| {
+ if *status == ConnectionReadyState::Closed {
+ set_active_games(vec![]);
+ }
+ })
+ });
+
+ view! {
+
+
+ Game Browser
+ {move || active_games().into_iter().map(|n| view! { - {n}
}).collect_view()}
+
+
+ }
+}
diff --git a/client/src/components/chat.rs b/client/src/components/chat.rs
index 743f0d1..e78b44d 100644
--- a/client/src/components/chat.rs
+++ b/client/src/components/chat.rs
@@ -95,37 +95,34 @@ pub fn Chat() -> impl IntoView {
Chat:
-
-
- Users:
- {move || users().into_iter().map(|n| view! {- {n}
}).collect_view()}
-
+
+
+ Users:
+ {move || users().into_iter().map(|n| view! { - {n}
}).collect_view()}
+
-
+
diff --git a/client/src/components/mod.rs b/client/src/components/mod.rs
index 9e8cf65..bee9b73 100644
--- a/client/src/components/mod.rs
+++ b/client/src/components/mod.rs
@@ -1,4 +1,5 @@
pub mod auth;
+pub mod browser;
pub mod chat;
pub mod debug;
pub mod websocket;
diff --git a/client/src/components/websocket.rs b/client/src/components/websocket.rs
index ae89700..8b29132 100644
--- a/client/src/components/websocket.rs
+++ b/client/src/components/websocket.rs
@@ -73,11 +73,13 @@ pub fn Websocket() -> impl IntoView {
let (user_update, set_user_update) = create_signal::