From c19d8d2d475d12b45b85e44682f39aaa70923d74 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 6 Sep 2022 21:06:04 -0400 Subject: Refactor current_bid handling in bidding box Align with representation used by the engine --- webapp/src/default.css | 3 ++- webapp/src/main.rs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'webapp/src') diff --git a/webapp/src/default.css b/webapp/src/default.css index e76ca28..7e34b66 100644 --- a/webapp/src/default.css +++ b/webapp/src/default.css @@ -19,7 +19,7 @@ body { .card { min-width: 30px; - min-height: 100px; + min-height: 80px; border: 1px solid #000; transition: 0.1s; font-family: Helvetica, sans-serif; @@ -27,6 +27,7 @@ body { padding: 3px; background-color: #fcfcf0; color: #000; + line-height: 90%; } .card div { diff --git a/webapp/src/main.rs b/webapp/src/main.rs index 846514a..dd69eca 100644 --- a/webapp/src/main.rs +++ b/webapp/src/main.rs @@ -64,7 +64,7 @@ pub fn app() -> Html {

{ "Bidding table" }

{ "Bidding box" }

- ().unwrap()} /> + ().unwrap())} />

{ "North" }

{ "West" }

@@ -73,6 +73,7 @@ pub fn app() -> Html {

{ "East" }

+

{ "Controls" }

} @@ -203,7 +204,7 @@ pub fn bidding_box(props: &BiddingBoxProps) -> Html { let bids: Html = Raise::all_raises() .iter() .map(|bid| { - let mut class = if bid < &props.lower_limit { + let mut class = if Some(*bid) <= props.current_bid { classes!("disabled") } else { classes!("enabled") @@ -229,8 +230,7 @@ pub fn bidding_box(props: &BiddingBoxProps) -> Html { #[derive(PartialEq, Properties, Clone)] pub struct BiddingBoxProps { - #[prop_or("1♣".parse().unwrap())] - lower_limit: Raise, + current_bid: Option, } #[cfg(test)] -- cgit v1.2.3