diff options
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/src/default.css | 3 | ||||
-rw-r--r-- | webapp/src/main.rs | 8 |
2 files changed, 6 insertions, 5 deletions
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 { <p>{ "Bidding table" }</p> <BiddingTable { bidding } /> <p>{ "Bidding box" }</p> - <BiddingBox lower_limit={"1H".parse::<Raise>().unwrap()} /> + <BiddingBox current_bid={Some("1H".parse::<Raise>().unwrap())} /> <p>{ "North" }</p> <Hand ..(*north).clone() /> <p>{ "West" }</p> @@ -73,6 +73,7 @@ pub fn app() -> Html { <Hand ..(*south).clone() /> <p>{ "East" }</p> <Hand ..(*east).clone() /> + <p>{ "Controls" }</p> <button onclick={shuffle}>{ "Shuffle" }</button> </> } @@ -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<Raise>, } #[cfg(test)] |