mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
🐛 Fix colorpalette navigation
This commit is contained in:
parent
8a31f67b42
commit
6394905022
1 changed files with 14 additions and 6 deletions
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
(mx/defc palette-item
|
(mx/defc palette-item
|
||||||
{:mixins [mx/static]}
|
{:mixins [mx/static]}
|
||||||
[color]
|
[color position]
|
||||||
(letfn [(select-color [event]
|
(letfn [(select-color [event]
|
||||||
(let [attrs (if (kbd/shift? event)
|
(let [attrs (if (kbd/shift? event)
|
||||||
{:stroke-color color}
|
{:stroke-color color}
|
||||||
|
@ -88,8 +88,12 @@
|
||||||
[:div.btn-palette.create i/close]]]
|
[:div.btn-palette.create i/close]]]
|
||||||
|
|
||||||
[:span.left-arrow {}
|
[:span.left-arrow {}
|
||||||
(when (> offset 0)
|
(if (> (:position @local) 0)
|
||||||
{:on-click #(swap! local update :offset (fnil dec 1))})
|
{:on-click #(swap! local update :position dec)}
|
||||||
|
{:class :disabled})
|
||||||
|
;; FIXME Objects are not valid as a React child (found: :on-click).
|
||||||
|
;;(when (> offset 0)
|
||||||
|
;; {:on-click #(swap! local update :offset (fnil dec 1))})
|
||||||
i/arrow-slide]
|
i/arrow-slide]
|
||||||
|
|
||||||
[:div.color-palette-content {:ref "container"}
|
[:div.color-palette-content {:ref "container"}
|
||||||
|
@ -100,9 +104,13 @@
|
||||||
(mx/with-key color)))]]
|
(mx/with-key color)))]]
|
||||||
|
|
||||||
[:span.right-arrow
|
[:span.right-arrow
|
||||||
(if (< offset invisible)
|
(if (< (* (+ 1 (:position @local)) 10) (count (:colors selected-coll)))
|
||||||
{:on-click #(swap! local update :offset (fnil inc 0))}
|
{:on-click #(swap! local update :position inc)}
|
||||||
{})
|
{:class :disabled})
|
||||||
|
;; FIXME Objects are not valid as a React child (found: :on-click).
|
||||||
|
;;(if (< offset invisible)
|
||||||
|
;; {:on-click #(swap! local update :offset (fnil inc 0))}
|
||||||
|
;; {})
|
||||||
i/arrow-slide]
|
i/arrow-slide]
|
||||||
[:span.close-palette {:on-click close}
|
[:span.close-palette {:on-click close}
|
||||||
i/close]])))
|
i/close]])))
|
||||||
|
|
Loading…
Add table
Reference in a new issue