0
Fork 0
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:
Andrey Antukh 2021-06-17 08:07:00 +02:00 committed by Andrés Moya
parent a548bd7ffd
commit 1d6905cb25
2 changed files with 5 additions and 8 deletions

View file

@ -59,10 +59,8 @@
file (obj/get props "file")
layout (obj/get props "layout")]
[:*
;; TODO: left-sidebar option is obsolete because left-sidebar now
;; is always visible.
(when (:colorpalette layout)
[:& colorpalette {:left-sidebar? true}])
[:& colorpalette])
[:section.workspace-content
[:section.workspace-viewport

View file

@ -60,7 +60,7 @@
[:& cb/color-name {:color color :size size}]]))
(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 })
width (:width @state 0)
@ -120,7 +120,7 @@
(fn []
(events/unlistenByKey key1))))
[:div.color-palette {:class (when left-sidebar? "left-sidebar-open")}
[:div.color-palette.left-sidebar-open
[:& dropdown {:show (:show-menu @state)
:on-close #(swap! state assoc :show-menu false)}
[:ul.workspace-context-menu.palette-menu
@ -192,7 +192,7 @@
(vals))))
(mf/defc colorpalette
[{:keys [left-sidebar?]}]
[]
(let [team-id (mf/use-ctx ctx/current-team-id)
recent-colors (mf/deref refs/workspace-recent-colors)
file-colors (mf/deref refs/workspace-file-colors)
@ -225,8 +225,7 @@
(reset! current-library-colors (into [] (->> (vals file-colors)
(sort-by :name)))))))
[:& palette {:left-sidebar? left-sidebar?
:current-colors @current-library-colors
[:& palette {:current-colors @current-library-colors
:recent-colors recent-colors
:file-colors file-colors
:shared-libs shared-libs