mirror of
https://github.com/penpot/penpot.git
synced 2026-05-31 20:58:08 +00:00
Merge pull request #2711 from penpot/palba-create-component-menu
🐛 Fix missing create component menu for frames
This commit is contained in:
commit
ebfe651b7d
@ -32,6 +32,7 @@
|
|||||||
- Fix problem when drawing boxes won't detect mouse-up [Taiga #4618](https://tree.taiga.io/project/penpot/issue/4618)
|
- Fix problem when drawing boxes won't detect mouse-up [Taiga #4618](https://tree.taiga.io/project/penpot/issue/4618)
|
||||||
- Fix missing loading icon on shared libraries [Taiga #4148](https://tree.taiga.io/project/penpot/issue/4148)
|
- Fix missing loading icon on shared libraries [Taiga #4148](https://tree.taiga.io/project/penpot/issue/4148)
|
||||||
- Fix selection stroke missing in properties of multiple texts [Taiga #4048](https://tree.taiga.io/project/penpot/issue/4048)
|
- Fix selection stroke missing in properties of multiple texts [Taiga #4048](https://tree.taiga.io/project/penpot/issue/4048)
|
||||||
|
- Fix missing create component menu for frames [Github #2670](https://github.com/penpot/penpot/issues/2670)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|||||||
@ -398,7 +398,6 @@
|
|||||||
[{:keys [shapes]}]
|
[{:keys [shapes]}]
|
||||||
(let [single? (= (count shapes) 1)
|
(let [single? (= (count shapes) 1)
|
||||||
|
|
||||||
has-frame? (->> shapes (d/seek cph/frame-shape?))
|
|
||||||
has-component? (some true? (map #(contains? % :component-id) shapes))
|
has-component? (some true? (map #(contains? % :component-id) shapes))
|
||||||
is-component? (and single? (-> shapes first :component-id some?))
|
is-component? (and single? (-> shapes first :component-id some?))
|
||||||
|
|
||||||
@ -454,19 +453,18 @@
|
|||||||
:accept-style :primary
|
:accept-style :primary
|
||||||
:on-accept do-update-component-in-bulk}))]
|
:on-accept do-update-component-in-bulk}))]
|
||||||
[:*
|
[:*
|
||||||
(when (not has-frame?)
|
[:*
|
||||||
[:*
|
[:& menu-separator]
|
||||||
[:& menu-separator]
|
[:& menu-entry {:title (tr "workspace.shape.menu.create-component")
|
||||||
[:& menu-entry {:title (tr "workspace.shape.menu.create-component")
|
:shortcut (sc/get-tooltip :create-component)
|
||||||
:shortcut (sc/get-tooltip :create-component)
|
:on-click do-add-component}]
|
||||||
:on-click do-add-component}]
|
(when (and has-component? (not single?))
|
||||||
(when (and has-component? (not single?))
|
[:*
|
||||||
[:*
|
[:& menu-entry {:title (tr "workspace.shape.menu.detach-instances-in-bulk")
|
||||||
[:& menu-entry {:title (tr "workspace.shape.menu.detach-instances-in-bulk")
|
:shortcut (sc/get-tooltip :detach-component)
|
||||||
:shortcut (sc/get-tooltip :detach-component)
|
:on-click do-detach-component-in-bulk}]
|
||||||
:on-click do-detach-component-in-bulk}]
|
[:& menu-entry {:title (tr "workspace.shape.menu.update-components-in-bulk")
|
||||||
[:& menu-entry {:title (tr "workspace.shape.menu.update-components-in-bulk")
|
:on-click do-update-in-bulk}]])]
|
||||||
:on-click do-update-in-bulk}]])])
|
|
||||||
|
|
||||||
(when is-component?
|
(when is-component?
|
||||||
;; WARNING: this menu is the same as the context menu at the sidebar.
|
;; WARNING: this menu is the same as the context menu at the sidebar.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user