summaryrefslogtreecommitdiff
path: root/webapp/src/components/table.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-12-03 13:49:54 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-12-03 13:49:54 -0500
commite6933ac48848b598f870ff5a9d96a0336728620b (patch)
tree3c6b9e9c9a6100b1400dd1a02fc07fbb5803d7b7 /webapp/src/components/table.rs
parent03ad7a9728c22a8016ade56f79049e32db5941ac (diff)
Display player turn in webapp
Diffstat (limited to 'webapp/src/components/table.rs')
-rw-r--r--webapp/src/components/table.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/webapp/src/components/table.rs b/webapp/src/components/table.rs
index a285449..7c0b3a3 100644
--- a/webapp/src/components/table.rs
+++ b/webapp/src/components/table.rs
@@ -1,10 +1,10 @@
-use crate::components::{Hand, BiddingTable, BiddingBox};
+use crate::components::{BiddingBox, BiddingTable, Hand};
use crate::use_app_context;
use crate::utils::ok_json;
use anyhow::Context;
use gloo_net::http::Request;
use log::info;
-use protocol::bridge_engine::GameStatePlayerView;
+use protocol::bridge_engine::{GameStatePlayerView, BiddingState, BiddingStatePlayerView};
use yew::prelude::*;
#[function_component(OnlineTable)]
@@ -72,24 +72,16 @@ pub fn table(props: &TableProps) -> Html {
})
};
let center = match &props.table {
- GameStatePlayerView::Bidding {
- bidding,
- ..
- } => html! {
+ GameStatePlayerView::Bidding(BiddingStatePlayerView { bidding, .. }) => html! {
<>
<BiddingTable bidding={bidding.clone()} />
<BiddingBox current_bid={bidding.highest_bid().clone()} { on_bid } />
+ { format!("It is {:?} to bid", bidding.current_bidder()) }
</>
},
- GameStatePlayerView::PassedOut {
- ..
- } => todo!(),
- GameStatePlayerView::Lead {
- ..
- } => todo!(),
- GameStatePlayerView::Play {
- ..
- } => todo!(),
+ GameStatePlayerView::PassedOut { .. } => todo!(),
+ GameStatePlayerView::Lead { .. } => todo!(),
+ GameStatePlayerView::Play { .. } => todo!(),
};
html! {
<>