summaryrefslogtreecommitdiff
path: root/webapp/src/components.rs
blob: d4b03ee4243a500182ff4288e044c071b768c079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use protocol::card::Suit;

mod app_context_provider;
mod bidding;
mod bidding_box;
mod bidding_table;
mod card;
mod error_info;
mod hand;
mod show_bid;
mod table;
mod trick_in_play;
mod tricks_played;

pub use self::app_context_provider::*;
pub use self::bidding::*;
pub use self::bidding_box::*;
pub use self::bidding_table::*;
pub use self::card::*;
pub use self::error_info::*;
pub use self::hand::*;
pub use self::show_bid::*;
pub use self::table::*;
pub use self::trick_in_play::*;
pub use self::tricks_played::*;

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),
    }
}