Last active
March 17, 2017 18:27
-
-
Save deque-blog/f64ef556b798e1bbe2edb97bff54171c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- player->css-style | |
[player highlight?] | |
(let [player-class (str "score--" (name player)) | |
score-class (if (highlight? player) "score--is-current" "score")] | |
(str player-class " " score-class))) | |
(defn- player->score-text | |
[player score] | |
(str (str/capitalize (name player)) " - " score)) | |
(defn- show-scores | |
[scores highlight?] | |
(for [player player/all :let [score (get scores player)]] | |
^{:key player} | |
[:div | |
{:class (player->css-style player highlight?)} | |
(player->score-text player score)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment