This commit is contained in:
Bryce Covert
2020-08-17 20:11:52 -07:00
parent 6a8bb77e95
commit 441077169f
5 changed files with 27 additions and 24 deletions

View File

@@ -107,7 +107,6 @@
[:> Consumer {}
(fn [consume]
(let [{:strs [on-params-change params] :as consume} (js->clj consume)]
(println "PARAMS" params)
(r/as-element (into
[:div {:style {:margin-bottom "1rem"}}
[:div.level
@@ -139,7 +138,7 @@
:class class}]
(r/children (r/current-component))))
(defn row [{:keys [class id checkable?]}]
(defn row [{:keys [class id checkable? entity] }]
(let [children (r/children (r/current-component))]
[:> Consumer {}
(fn [consume]
@@ -153,9 +152,15 @@
"")
:on-change (fn [x e]
(let [checked (or checked #{})]
(if (get checked id)
(on-check-changed (disj checked id))
(on-check-changed (conj checked id)))))}
;; TODO only map once everything is moved over to data-page
(if (map? checked)
(if (get checked id)
(on-check-changed (dissoc checked id))
(on-check-changed (assoc checked id entity)))
(if (get checked id)
(on-check-changed (disj checked id))
(on-check-changed (conj checked id))))))}
(boolean? checkable?) (assoc :disabled (not checkable?))) ]]))
(map r/as-element children))))]))