Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 17, 2017 18:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save deque-blog/f64ef556b798e1bbe2edb97bff54171c to your computer and use it in GitHub Desktop.
(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