diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-09-11 11:12:16 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-09-11 11:12:16 -0400 |
commit | 3fb6f32a46b0cdfc59643bee255648e1ef401116 (patch) | |
tree | 8d96d1dadae5e82b92e6d1ee7f4203724eb08609 /webapp/src/components/show_bid.rs | |
parent | 55a24a3b7d1b3fcc07f0bb8e53b00abf23e651b3 (diff) |
Refactor passed contract into Option<Contract>
Diffstat (limited to 'webapp/src/components/show_bid.rs')
-rw-r--r-- | webapp/src/components/show_bid.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/webapp/src/components/show_bid.rs b/webapp/src/components/show_bid.rs index b0c917e..2ab2d5c 100644 --- a/webapp/src/components/show_bid.rs +++ b/webapp/src/components/show_bid.rs @@ -1,10 +1,9 @@ -use crate::bridge_engine::{Bid, Bidding, Contract}; -use crate::components::bid_css_class; +use crate::bridge_engine::{Bidding, Contract}; use yew::prelude::*; #[derive(PartialEq, Properties, Clone)] pub struct ShowBidProps { - pub contract: Contract, + pub contract: Option<Contract>, pub bidding: Bidding, } @@ -12,7 +11,12 @@ pub struct ShowBidProps { pub fn show_bid(props: &ShowBidProps) -> Html { html! { <> - <p>{ format!("{}", props.contract) }</p> + <p>{ + match props.contract { + None => "Passed".to_string(), + Some(c) => format!("{}", c), + } + }</p> </> } } |