From b800fcafb47dd80f0065cdd9b39d38b4ba084dd5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 18 Oct 2024 16:47:29 +0200 Subject: [PATCH] :lipstick: Add minor improvements to dashboard project menu --- frontend/src/app/main/ui/dashboard/files.cljs | 16 ++++++++-------- .../src/app/main/ui/dashboard/project_menu.cljs | 7 ++++--- frontend/src/app/main/ui/dashboard/projects.cljs | 6 +++--- frontend/src/app/main/ui/dashboard/sidebar.cljs | 14 +++++++------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard/files.cljs b/frontend/src/app/main/ui/dashboard/files.cljs index d6d2b76c5..019e7b502 100644 --- a/frontend/src/app/main/ui/dashboard/files.cljs +++ b/frontend/src/app/main/ui/dashboard/files.cljs @@ -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} diff --git a/frontend/src/app/main/ui/dashboard/project_menu.cljs b/frontend/src/app/main/ui/dashboard/project_menu.cljs index f3168a87c..f99da5d3d 100644 --- a/frontend/src/app/main/ui/dashboard/project_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/project_menu.cljs @@ -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 diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 3c85f5c41..1039daabe 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -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 diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index 0f3565bdb..2e53b3bf7 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -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}]