mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 00:58:26 -05:00
Show project count in dashboard
This commit is contained in:
parent
3a31abac5a
commit
7830c11a16
2 changed files with 11 additions and 6 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
(defonce +locales+
|
||||
{"ds.projects" "PROJECTS"
|
||||
"ds.num-projects" ["No projects"
|
||||
"%s project"
|
||||
"%s projects"]
|
||||
|
||||
"ds.elements" "ELEMENTS"
|
||||
"ds.icons" "ICONS"
|
||||
"ds.colors" "COLORS"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
[rum.core :as rum]
|
||||
[cats.labs.lens :as l]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.locales :as t :refer (tr)]
|
||||
[uxbox.router :as r]
|
||||
[uxbox.rstore :as rs]
|
||||
[uxbox.state :as s]
|
||||
|
@ -149,9 +150,9 @@
|
|||
;; Menu
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (def ^:static menu-l
|
||||
;; (as-> (l/select-keys [:projects]) $
|
||||
;; (l/focus-atom $ s/state)))
|
||||
(def ^:static menu-l
|
||||
(as-> (l/select-keys [:projects-by-id]) $
|
||||
(l/focus-atom $ s/state)))
|
||||
|
||||
(rum/defc project-sort-selector < rum/reactive
|
||||
[sort-order]
|
||||
|
@ -166,12 +167,12 @@
|
|||
|
||||
(defn menu-render
|
||||
[]
|
||||
(let [state {:projects []} #_(rum/react menu-l)
|
||||
pcount (count (:projects state))]
|
||||
(let [projects (rum/react menu-l)
|
||||
pcount (count (:projects-by-id projects))] ;; FIXME: redundant project-by-id key
|
||||
(html
|
||||
[:section#dashboard-bar.dashboard-bar
|
||||
[:div.dashboard-info
|
||||
[:span.dashboard-projects pcount " projects"]
|
||||
[:span.dashboard-projects (tr "ds.num-projects" (t/c pcount))]
|
||||
[:span "Sort by"]]
|
||||
[:div.dashboard-search
|
||||
i/search]])))
|
||||
|
|
Loading…
Add table
Reference in a new issue