diff options
Diffstat (limited to 'webapp/src/components/table.rs')
-rw-r--r-- | webapp/src/components/table.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/webapp/src/components/table.rs b/webapp/src/components/table.rs index 92302b2..c4f693e 100644 --- a/webapp/src/components/table.rs +++ b/webapp/src/components/table.rs @@ -1,6 +1,6 @@ use gloo_net::http::Request; use log::info; -use protocol::bridge_engine::TableView; +use protocol::bridge_engine::GameStatePlayerView; use yew::prelude::*; use crate::use_app_context; use crate::components::Hand; @@ -9,7 +9,7 @@ use crate::components::Hand; pub fn online_table(props: &OnlineTableProps) -> Html { let ctx = use_app_context(); - let table_state: UseStateHandle<Option<TableView>> = use_state(|| None); + let table_state: UseStateHandle<Option<GameStatePlayerView>> = use_state(|| None); { // TODO update this from server state let table_state = table_state.clone(); @@ -21,6 +21,7 @@ pub fn online_table(props: &OnlineTableProps) -> Html { let response = Request::get(&format!("/api/table/{}", props.table.id)) .send() .await?; + // info!("Got response: {:#?}", response.body()); let table = response.json().await?; table_state.set(Some(table)); Ok(()) @@ -66,7 +67,7 @@ pub fn table(props: &TableProps) -> Html { html! { <> <div class="hand south"> - <Hand cards={ props.table.hand.clone() } on_card_clicked={ on_card_clicked.clone() } /> + <Hand cards={ props.table.hand().clone() } on_card_clicked={ on_card_clicked.clone() } /> </div> <h2>{ "Table view" }</h2> <pre>{ format!("{:#?}", props.table) }</pre> @@ -76,5 +77,5 @@ pub fn table(props: &TableProps) -> Html { #[derive(PartialEq, Properties, Clone)] pub struct TableProps { - pub table: TableView, + pub table: GameStatePlayerView, } |