      [:div.card__details details-style
       (:description @card-ref)
       [render-tasks (:tasks @card-ref) on-remove-task on-check-task]
-      [render-add-task card-ref]
+      [render-add-task on-add-task]
     ]]
   ))
 

        details-style (when-not show-details {:style {:display "none"}})
        on-remove-task #(swap! card-ref api/remove-task-at %)
        on-check-task #(swap! card-ref update-in [:tasks % :done] not)
        ]
    [:div.card
     [:div {:style (card-side-color @card-ref)}]

  ])

(defn render-add-task
  "[Pure] Render the text field to add new tasks to a card"
  [on-add]
  [:input.checklist--add-task
   {:type "text"
    :placeholder "Type then hit Enter to add a task"
    :on-key-press
    (fn [e]
      (when (= "Enter" (.-key e))
        (on-add (.. e -target -value)) 
        (set! (.. e -target -value) "")
      ))
   }])
