0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

📎 Minor cosmetic fixes on workspace shape wrapper component.

This commit is contained in:
Andrey Antukh 2020-11-25 17:03:30 +01:00 committed by Hirunatan
parent 76d8ca1e72
commit 5a17237015

View file

@ -90,23 +90,21 @@
on-mouse-enter (use-mouse-enter shape)
on-mouse-leave (use-mouse-leave shape)
alt? (hooks/use-rxsub ms/keyboard-alt)
moving-iref (mf/use-memo (mf/deps (:id shape))
#(make-is-moving-ref (:id shape)))
moving? (mf/deref moving-iref)]
(hooks/use-stream ms/keyboard-alt #(reset! alt? %))
(mf/use-effect
(fn []
(fn []
(on-mouse-leave))))
(constantly on-mouse-leave))
(when (and shape
(or ghost? (not moving?))
(not (:hidden shape)))
[:g.shape-wrapper {:on-mouse-enter on-mouse-enter
:on-mouse-leave on-mouse-leave
:style {:cursor (if @alt? cur/duplicate nil)}}
:style {:cursor (if alt? cur/duplicate nil)}}
(case (:type shape)
:path [:> path/path-wrapper opts]
:text [:> text/text-wrapper opts]