diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-09-06 22:07:28 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-09-06 22:07:28 -0400 |
commit | cab440c8a209ae92eba07d50f7b7127dadbd65c0 (patch) | |
tree | 95ad002ad00b6ae99baeb410cc23195286cf5d45 /webapp/src/components.rs | |
parent | 77ed77bfa3480a06a3f36b072af5eb8712a1515c (diff) |
Move components to a separate module
Diffstat (limited to 'webapp/src/components.rs')
-rw-r--r-- | webapp/src/components.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/webapp/src/components.rs b/webapp/src/components.rs new file mode 100644 index 0000000..fed31b0 --- /dev/null +++ b/webapp/src/components.rs @@ -0,0 +1,27 @@ +use crate::card::Suit; + +mod card; +mod hand; +mod bidding_table; +mod bidding_box; + +pub use self::card::*; +pub use self::bidding_box::*; +pub use self::bidding_table::*; +pub use self::hand::*; + +pub fn suit_css_class(suit: Suit) -> &'static str { + match suit { + Suit::Club => "suit-club", + Suit::Diamond => "suit-diamond", + Suit::Heart => "suit-heart", + Suit::Spade => "suit-spade", + } +} + +pub fn bid_css_class(suit: Option<Suit>) -> &'static str { + match suit { + None => "suit-notrump", + Some(x) => suit_css_class(x), + } +} |