mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 00:01:40 +02:00
🐛 Make accept and cancel handlers optional on actionable*
This commit is contained in:
parent
cf55d12991
commit
8f600f334f
1 changed files with 14 additions and 10 deletions
|
@ -17,10 +17,10 @@
|
||||||
[:class {:optional true} :string]
|
[:class {:optional true} :string]
|
||||||
[:variant {:optional true}
|
[:variant {:optional true}
|
||||||
[:maybe [:enum "default" "error"]]]
|
[:maybe [:enum "default" "error"]]]
|
||||||
[:accept-label {:optional true} :string]
|
[:accept-label {:optional true} [:maybe :string]]
|
||||||
[:cancel-label {:optional true} :string]
|
[:cancel-label {:optional true} [:maybe :string]]
|
||||||
[:on-accept {:optional true} [:fn fn?]]
|
[:on-accept {:optional true} [:maybe [:fn fn?]]]
|
||||||
[:on-cancel {:optional true} [:fn fn?]]])
|
[:on-cancel {:optional true} [:maybe [:fn fn?]]]])
|
||||||
|
|
||||||
(mf/defc actionable*
|
(mf/defc actionable*
|
||||||
{::mf/schema schema:actionable}
|
{::mf/schema schema:actionable}
|
||||||
|
@ -45,9 +45,13 @@
|
||||||
|
|
||||||
[:> :aside props
|
[:> :aside props
|
||||||
[:div {:class (stl/css :notification-message)} children]
|
[:div {:class (stl/css :notification-message)} children]
|
||||||
[:> button* {:variant "secondary"
|
|
||||||
:on-click on-cancel}
|
(when cancel-label
|
||||||
cancel-label]
|
[:> button* {:variant "secondary"
|
||||||
[:> button* {:variant (if (= variant "default") "primary" "destructive")
|
:on-click on-cancel}
|
||||||
:on-click on-accept}
|
cancel-label])
|
||||||
accept-label]]))
|
|
||||||
|
(when accept-label
|
||||||
|
[:> button* {:variant (if (= variant "default") "primary" "destructive")
|
||||||
|
:on-click on-accept}
|
||||||
|
accept-label])]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue