summaryrefslogtreecommitdiff
path: root/webapp/src/components.rs
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/components.rs')
-rw-r--r--webapp/src/components.rs27
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),
+ }
+}