0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 21:38:53 -05:00

Use server side num icons value on icons dashboard page.

This commit is contained in:
Andrey Antukh 2016-10-21 00:20:56 +02:00
parent 3df32e903f
commit 94e3842267

View file

@ -130,11 +130,11 @@
(mx/defc nav-item (mx/defc nav-item
{:mixins [mx/static mx/reactive]} {:mixins [mx/static mx/reactive]}
[{:keys [id type name] :as coll} selected?] [{:keys [id type name num-icons] :as coll} selected?]
(letfn [(on-click [event] (letfn [(on-click [event]
(let [type (or type :own)] (let [type (or type :own)]
(rs/emit! (di/select-collection type id))))] (rs/emit! (di/select-collection type id))))]
(let [num-icons (react-count-icons id)] (let [num-icons (or num-icons (react-count-icons id))]
[:li {:on-click on-click [:li {:on-click on-click
:class-name (when selected? "current")} :class-name (when selected? "current")}
[:span.element-title [:span.element-title
@ -290,10 +290,10 @@
(mx/defc menu (mx/defc menu
{:mixins [mx/static mx/reactive]} {:mixins [mx/static mx/reactive]}
[state {:keys [id] :as coll}] [state {:keys [id num-icons] :as coll}]
(let [ordering (:order state :name) (let [ordering (:order state :name)
filtering (:filter state "") filtering (:filter state "")
num-icons (react-count-icons id)] num-icons (or num-icons (react-count-icons id))]
(letfn [(on-term-change [event] (letfn [(on-term-change [event]
(let [term (-> (dom/get-target event) (let [term (-> (dom/get-target event)
(dom/get-value))] (dom/get-value))]