mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
💄 Add minor improvements to dashboard project menu
This commit is contained in:
parent
6b997928e5
commit
b800fcafb4
4 changed files with 22 additions and 21 deletions
|
@ -14,7 +14,7 @@
|
|||
[app.main.ui.dashboard.grid :refer [grid]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
[app.main.ui.dashboard.pin-button :refer [pin-button*]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu*]]
|
||||
[app.main.ui.ds.product.empty-placeholder :refer [empty-placeholder*]]
|
||||
[app.main.ui.hooks :as hooks]
|
||||
[app.main.ui.icons :as i]
|
||||
|
@ -118,13 +118,13 @@
|
|||
menu-icon])
|
||||
|
||||
(when ^boolean can-edit
|
||||
[:& project-menu {:project project
|
||||
:show? (:menu-open @local)
|
||||
:left (- (:x (:menu-pos @local)) 180)
|
||||
:top (:y (:menu-pos @local))
|
||||
:on-edit on-edit
|
||||
:on-menu-close on-menu-close
|
||||
:on-import on-import}])]]))
|
||||
[:> project-menu* {:project project
|
||||
:show (:menu-open @local)
|
||||
:left (- (:x (:menu-pos @local)) 180)
|
||||
:top (:y (:menu-pos @local))
|
||||
:on-edit on-edit
|
||||
:on-menu-close on-menu-close
|
||||
:on-import on-import}])]]))
|
||||
|
||||
(mf/defc files-section
|
||||
{::mf/props :obj}
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
[app.util.router :as rt]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc project-menu
|
||||
[{:keys [project show? on-edit on-menu-close top left on-import] :as props}]
|
||||
(mf/defc project-menu*
|
||||
{::mf/props :obj}
|
||||
[{:keys [project show on-edit on-menu-close top left on-import]}]
|
||||
(let [top (or top 0)
|
||||
left (or left 0)
|
||||
|
||||
|
@ -117,7 +118,7 @@
|
|||
[:*
|
||||
[:> context-menu*
|
||||
{:on-close on-menu-close
|
||||
:show show?
|
||||
:show show
|
||||
:fixed (or (not= top 0) (not= left 0))
|
||||
:min-width true
|
||||
:top top
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
[app.main.ui.dashboard.grid :refer [line-grid]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
[app.main.ui.dashboard.pin-button :refer [pin-button*]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu*]]
|
||||
[app.main.ui.ds.product.empty-placeholder :refer [empty-placeholder*]]
|
||||
[app.main.ui.hooks :as hooks]
|
||||
[app.main.ui.icons :as i]
|
||||
|
@ -264,9 +264,9 @@
|
|||
menu-icon])]
|
||||
|
||||
(when ^boolean can-edit
|
||||
[:& project-menu
|
||||
[:> project-menu*
|
||||
{:project project
|
||||
:show? (:menu-open @local)
|
||||
:show (:menu-open @local)
|
||||
:left (+ 24 (:x (:menu-pos @local)))
|
||||
:top (:y (:menu-pos @local))
|
||||
:on-edit on-edit-open
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
[app.main.ui.components.link :refer [link]]
|
||||
[app.main.ui.dashboard.comments :refer [comments-icon comments-section]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu*]]
|
||||
[app.main.ui.dashboard.team-form]
|
||||
[app.main.ui.icons :as i :refer [icon-xref]]
|
||||
[app.util.dom :as dom]
|
||||
|
@ -181,12 +181,12 @@
|
|||
[:& inline-edition {:content (:name item)
|
||||
:on-end on-edit}]
|
||||
[:span {:class (stl/css :element-title)} (:name item)])]
|
||||
[:& project-menu {:project item
|
||||
:show? (:menu-open local)
|
||||
:left (:x (:menu-pos local))
|
||||
:top (:y (:menu-pos local))
|
||||
:on-edit on-edit-open
|
||||
:on-menu-close on-menu-close}]]))
|
||||
[:> project-menu* {:project item
|
||||
:show (:menu-open local)
|
||||
:left (:x (:menu-pos local))
|
||||
:top (:y (:menu-pos local))
|
||||
:on-edit on-edit-open
|
||||
:on-menu-close on-menu-close}]]))
|
||||
|
||||
(mf/defc sidebar-search
|
||||
[{:keys [search-term team-id] :as props}]
|
||||
|
|
Loading…
Add table
Reference in a new issue