mirror of
https://github.com/penpot/penpot.git
synced 2025-05-16 18:26:16 +02:00
💄 Hide strike options when strike is none
This commit is contained in:
parent
9f664f5239
commit
5809a67e4c
1 changed files with 32 additions and 25 deletions
|
@ -21,7 +21,9 @@
|
|||
|
||||
(mf/defc stroke-menu
|
||||
[{:keys [shape] :as props}]
|
||||
(let [on-stroke-style-change
|
||||
(let [show-options (not= (:stroke-style shape) :none)
|
||||
|
||||
on-stroke-style-change
|
||||
(fn [event]
|
||||
(let [value (-> (dom/get-target event)
|
||||
(dom/get-value)
|
||||
|
@ -69,16 +71,20 @@
|
|||
[:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
|
||||
[:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]]
|
||||
|
||||
[:div.input-element.pixels
|
||||
[:div.input-element {:class (when show-options "pixels")}
|
||||
(when show-options
|
||||
[:input.input-text {:type "number"
|
||||
:min "0"
|
||||
:value (-> (:stroke-width shape)
|
||||
(math/precision 2)
|
||||
(d/coalesce-str "1"))
|
||||
:on-change on-stroke-width-change}]]]
|
||||
:on-change on-stroke-width-change}])]]
|
||||
|
||||
;; Stroke Color
|
||||
(when show-options
|
||||
[:*
|
||||
[:span (tr "workspace.options.color")]
|
||||
|
||||
[:div.row-flex.color-data
|
||||
[:span.color-th {:style {:background-color (:stroke-color shape)}
|
||||
:on-click show-color-picker}]
|
||||
|
@ -87,6 +93,7 @@
|
|||
:default-value (:stroke-color shape "")}]]]
|
||||
|
||||
[:span (tr "workspace.options.opacity")]
|
||||
|
||||
[:div.row-flex
|
||||
[:input.slidebar {:type "range"
|
||||
:min "0"
|
||||
|
@ -95,4 +102,4 @@
|
|||
(* 10000)
|
||||
(d/coalesce-str "1"))
|
||||
:step "1"
|
||||
:on-change on-stroke-opacity-change}]]]]))
|
||||
:on-change on-stroke-opacity-change}]]])]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue