mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 03:08:29 +02:00
Move dashboard builtints to library.
This commit is contained in:
parent
d8e7087af6
commit
11bb081c7c
3 changed files with 18 additions and 15 deletions
|
@ -1,43 +0,0 @@
|
|||
(ns uxbox.ui.dashboard.builtins)
|
||||
|
||||
(def ^:static +color-collections+
|
||||
[{:name "Generic 1"
|
||||
:id 1
|
||||
:builtin true
|
||||
:colors #{"#00f9ff"
|
||||
"#009fff"
|
||||
"#0078ff"
|
||||
"#005eff"
|
||||
"#0900ff"
|
||||
"#7502f1"
|
||||
"#ffe705"
|
||||
"#00ffab"
|
||||
"#f52105"
|
||||
}}
|
||||
{:name "Generic 2"
|
||||
:id 2
|
||||
:builtin true
|
||||
:colors #{"#20f9ff"
|
||||
"#209fff"
|
||||
"#2078ff"
|
||||
"#205eff"
|
||||
"#2900ff"
|
||||
"#3502f1"
|
||||
"#3fe705"
|
||||
"#30ffab"
|
||||
"#352105"
|
||||
"#209f20"
|
||||
"#207820"
|
||||
"#205e20"
|
||||
"#290020"
|
||||
"#350220"
|
||||
"#3fe720"
|
||||
"#30ff20"
|
||||
"#352120"
|
||||
"#352140"
|
||||
}}])
|
||||
|
||||
(def ^:static +color-collections-by-id+
|
||||
(let [data (transient {})]
|
||||
(run! #(assoc! data (:id %) %) +color-collections+)
|
||||
(persistent! data)))
|
|
@ -6,11 +6,11 @@
|
|||
[uxbox.state :as st]
|
||||
[uxbox.rstore :as rs]
|
||||
[uxbox.schema :as sc]
|
||||
[uxbox.library :as library]
|
||||
[uxbox.data.dashboard :as dd]
|
||||
[uxbox.util.lens :as ul]
|
||||
[uxbox.ui.icons :as i]
|
||||
[uxbox.ui.form :as form]
|
||||
[uxbox.ui.dashboard.builtins :as builtins]
|
||||
[uxbox.ui.lightbox :as lightbox]
|
||||
[uxbox.ui.colorpicker :refer (colorpicker)]
|
||||
[uxbox.ui.dom :as dom]
|
||||
|
@ -40,7 +40,7 @@
|
|||
(defn- get-collection
|
||||
[type id]
|
||||
(case type
|
||||
:builtin (get builtins/+color-collections-by-id+ id)
|
||||
:builtin (get library/+color-collections-by-id+ id)
|
||||
:own (get-in @st/state [:colors-by-id id])))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -110,7 +110,7 @@
|
|||
builtin? (= (:collection-type dashboard) :builtin)
|
||||
collections (if own?
|
||||
(sort-by :id (vals colors))
|
||||
builtins/+color-collections+)]
|
||||
library/+color-collections+)]
|
||||
(html
|
||||
[:div.library-bar
|
||||
[:div.library-bar-inside
|
||||
|
@ -152,7 +152,7 @@
|
|||
coll-id (:collection-id dashboard)
|
||||
own? (= coll-type :own)
|
||||
coll (case coll-type
|
||||
:builtin (get builtins/+color-collections-by-id+ coll-id)
|
||||
:builtin (get library/+color-collections-by-id+ coll-id)
|
||||
:own (rum/react collection-state))
|
||||
edit-cb #(lightbox/open! :color-form {:coll coll :color %})
|
||||
remove-cb #(rs/emit! (dd/remove-color {:id (:id coll) :color %}))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue