mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 08:11:30 -05:00
🔥 Remove obsoleted props on colorpalette component.
This commit is contained in:
parent
a548bd7ffd
commit
1d6905cb25
2 changed files with 5 additions and 8 deletions
|
@ -59,10 +59,8 @@
|
||||||
file (obj/get props "file")
|
file (obj/get props "file")
|
||||||
layout (obj/get props "layout")]
|
layout (obj/get props "layout")]
|
||||||
[:*
|
[:*
|
||||||
;; TODO: left-sidebar option is obsolete because left-sidebar now
|
|
||||||
;; is always visible.
|
|
||||||
(when (:colorpalette layout)
|
(when (:colorpalette layout)
|
||||||
[:& colorpalette {:left-sidebar? true}])
|
[:& colorpalette])
|
||||||
|
|
||||||
[:section.workspace-content
|
[:section.workspace-content
|
||||||
[:section.workspace-viewport
|
[:section.workspace-viewport
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
[:& cb/color-name {:color color :size size}]]))
|
[:& cb/color-name {:color color :size size}]]))
|
||||||
|
|
||||||
(mf/defc palette
|
(mf/defc palette
|
||||||
[{:keys [left-sidebar? current-colors recent-colors file-colors shared-libs selected size]}]
|
[{:keys [current-colors recent-colors file-colors shared-libs selected size]}]
|
||||||
(let [state (mf/use-state {:show-menu false })
|
(let [state (mf/use-state {:show-menu false })
|
||||||
|
|
||||||
width (:width @state 0)
|
width (:width @state 0)
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
(fn []
|
(fn []
|
||||||
(events/unlistenByKey key1))))
|
(events/unlistenByKey key1))))
|
||||||
|
|
||||||
[:div.color-palette {:class (when left-sidebar? "left-sidebar-open")}
|
[:div.color-palette.left-sidebar-open
|
||||||
[:& dropdown {:show (:show-menu @state)
|
[:& dropdown {:show (:show-menu @state)
|
||||||
:on-close #(swap! state assoc :show-menu false)}
|
:on-close #(swap! state assoc :show-menu false)}
|
||||||
[:ul.workspace-context-menu.palette-menu
|
[:ul.workspace-context-menu.palette-menu
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
(vals))))
|
(vals))))
|
||||||
|
|
||||||
(mf/defc colorpalette
|
(mf/defc colorpalette
|
||||||
[{:keys [left-sidebar?]}]
|
[]
|
||||||
(let [team-id (mf/use-ctx ctx/current-team-id)
|
(let [team-id (mf/use-ctx ctx/current-team-id)
|
||||||
recent-colors (mf/deref refs/workspace-recent-colors)
|
recent-colors (mf/deref refs/workspace-recent-colors)
|
||||||
file-colors (mf/deref refs/workspace-file-colors)
|
file-colors (mf/deref refs/workspace-file-colors)
|
||||||
|
@ -225,8 +225,7 @@
|
||||||
(reset! current-library-colors (into [] (->> (vals file-colors)
|
(reset! current-library-colors (into [] (->> (vals file-colors)
|
||||||
(sort-by :name)))))))
|
(sort-by :name)))))))
|
||||||
|
|
||||||
[:& palette {:left-sidebar? left-sidebar?
|
[:& palette {:current-colors @current-library-colors
|
||||||
:current-colors @current-library-colors
|
|
||||||
:recent-colors recent-colors
|
:recent-colors recent-colors
|
||||||
:file-colors file-colors
|
:file-colors file-colors
|
||||||
:shared-libs shared-libs
|
:shared-libs shared-libs
|
||||||
|
|
Loading…
Add table
Reference in a new issue