💄 Add minor improvements to dashboard project menu

This commit is contained in:
Andrey Antukh 2024-10-18 16:47:29 +02:00 committed by Alonso Torres
parent 6b997928e5
commit b800fcafb4
4 changed files with 22 additions and 21 deletions

View file

@ -14,7 +14,7 @@
[app.main.ui.dashboard.grid :refer [grid]] [app.main.ui.dashboard.grid :refer [grid]]
[app.main.ui.dashboard.inline-edition :refer [inline-edition]] [app.main.ui.dashboard.inline-edition :refer [inline-edition]]
[app.main.ui.dashboard.pin-button :refer [pin-button*]] [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.ds.product.empty-placeholder :refer [empty-placeholder*]]
[app.main.ui.hooks :as hooks] [app.main.ui.hooks :as hooks]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
@ -118,13 +118,13 @@
menu-icon]) menu-icon])
(when ^boolean can-edit (when ^boolean can-edit
[:& project-menu {:project project [:> project-menu* {:project project
:show? (:menu-open @local) :show (:menu-open @local)
:left (- (:x (:menu-pos @local)) 180) :left (- (:x (:menu-pos @local)) 180)
:top (:y (:menu-pos @local)) :top (:y (:menu-pos @local))
:on-edit on-edit :on-edit on-edit
:on-menu-close on-menu-close :on-menu-close on-menu-close
:on-import on-import}])]])) :on-import on-import}])]]))
(mf/defc files-section (mf/defc files-section
{::mf/props :obj} {::mf/props :obj}

View file

@ -19,8 +19,9 @@
[app.util.router :as rt] [app.util.router :as rt]
[rumext.v2 :as mf])) [rumext.v2 :as mf]))
(mf/defc project-menu (mf/defc project-menu*
[{:keys [project show? on-edit on-menu-close top left on-import] :as props}] {::mf/props :obj}
[{:keys [project show on-edit on-menu-close top left on-import]}]
(let [top (or top 0) (let [top (or top 0)
left (or left 0) left (or left 0)
@ -117,7 +118,7 @@
[:* [:*
[:> context-menu* [:> context-menu*
{:on-close on-menu-close {:on-close on-menu-close
:show show? :show show
:fixed (or (not= top 0) (not= left 0)) :fixed (or (not= top 0) (not= left 0))
:min-width true :min-width true
:top top :top top

View file

@ -16,7 +16,7 @@
[app.main.ui.dashboard.grid :refer [line-grid]] [app.main.ui.dashboard.grid :refer [line-grid]]
[app.main.ui.dashboard.inline-edition :refer [inline-edition]] [app.main.ui.dashboard.inline-edition :refer [inline-edition]]
[app.main.ui.dashboard.pin-button :refer [pin-button*]] [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.ds.product.empty-placeholder :refer [empty-placeholder*]]
[app.main.ui.hooks :as hooks] [app.main.ui.hooks :as hooks]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
@ -264,9 +264,9 @@
menu-icon])] menu-icon])]
(when ^boolean can-edit (when ^boolean can-edit
[:& project-menu [:> project-menu*
{:project project {:project project
:show? (:menu-open @local) :show (:menu-open @local)
:left (+ 24 (:x (:menu-pos @local))) :left (+ 24 (:x (:menu-pos @local)))
:top (:y (:menu-pos @local)) :top (:y (:menu-pos @local))
:on-edit on-edit-open :on-edit on-edit-open

View file

@ -22,7 +22,7 @@
[app.main.ui.components.link :refer [link]] [app.main.ui.components.link :refer [link]]
[app.main.ui.dashboard.comments :refer [comments-icon comments-section]] [app.main.ui.dashboard.comments :refer [comments-icon comments-section]]
[app.main.ui.dashboard.inline-edition :refer [inline-edition]] [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.dashboard.team-form]
[app.main.ui.icons :as i :refer [icon-xref]] [app.main.ui.icons :as i :refer [icon-xref]]
[app.util.dom :as dom] [app.util.dom :as dom]
@ -181,12 +181,12 @@
[:& inline-edition {:content (:name item) [:& inline-edition {:content (:name item)
:on-end on-edit}] :on-end on-edit}]
[:span {:class (stl/css :element-title)} (:name item)])] [:span {:class (stl/css :element-title)} (:name item)])]
[:& project-menu {:project item [:> project-menu* {:project item
:show? (:menu-open local) :show (:menu-open local)
:left (:x (:menu-pos local)) :left (:x (:menu-pos local))
:top (:y (:menu-pos local)) :top (:y (:menu-pos local))
:on-edit on-edit-open :on-edit on-edit-open
:on-menu-close on-menu-close}]])) :on-menu-close on-menu-close}]]))
(mf/defc sidebar-search (mf/defc sidebar-search
[{:keys [search-term team-id] :as props}] [{:keys [search-term team-id] :as props}]