浏览代码

enhance: Reorder menu items and add separators

Konstantinos Kaloutas 3 年之前
父节点
当前提交
1d5e22d8f6
共有 1 个文件被更改,包括 28 次插入20 次删除
  1. 28 20
      src/main/frontend/components/content.cljs

+ 28 - 20
src/main/frontend/components/content.cljs

@@ -144,11 +144,11 @@
                                           (editor-handler/set-block-property! block-id :template-including-parent false))
                                         (state/hide-custom-context-menu!)))))))])
       (ui/menu-link
-       {:key "Make template"
+       {:key "Make a Template"
         :on-click (fn [e]
                     (util/stop e)
                     (reset! edit? true))}
-       "Make template"))))
+       "Make a Template"))))
 
 (rum/defc ^:large-vars/cleanup-todo block-context-menu-content
   [_target block-id]
@@ -156,7 +156,7 @@
       (let [properties (:block/properties block)
             heading? (true? (:heading properties))]
         [:.menu-links-wrapper
-         [:div.flex-row.flex.justify-between.py-4.pl-2
+         [:div.flex-row.flex.justify-between.pb-2.pt-1.pl-2
           [:div.flex-row.flex.justify-between
            (for [color block-background-colors]
              [:a.m-2.shadow-sm
@@ -170,16 +170,8 @@
             :on-click (fn [_e]
                         (editor-handler/remove-block-property! block-id "background-color"))}
            "Clear"]]
-
-         (ui/menu-link
-          {:key      "Convert heading"
-           :on-click (fn [_e]
-                       (if heading?
-                         (editor-handler/remove-block-property! block-id :heading)
-                         (editor-handler/set-block-property! block-id :heading true)))}
-          (if heading?
-            "Convert back to a block"
-            "Convert to a heading"))
+         
+         [:hr.my-1]
 
          (ui/menu-link
           {:key      "Open in sidebar"
@@ -187,6 +179,8 @@
                        (editor-handler/open-block-in-sidebar! block-id))}
           "Open in sidebar")
 
+         [:hr.my-1]
+
          (ui/menu-link
           {:key      "Copy block ref"
            :on-click (fn [_e]
@@ -210,14 +204,32 @@
                            (editor-handler/copy-block-ref! block-id tap-f)))}
             "Copy block URL"))
 
-         (block-template block-id)
-
          (ui/menu-link
           {:key      "Copy as"
            :on-click (fn [_]
                        (state/set-modal! #(export/export-blocks [block-id])))}
           "Copy as")
 
+         (ui/menu-link
+          {:key      "Cut"
+           :on-click (fn [_e]
+                       (editor-handler/cut-block! block-id))}
+          "Cut")
+
+         [:hr.my-1]
+
+         (ui/menu-link
+          {:key      "Convert heading"
+           :on-click (fn [_e]
+                       (if heading?
+                         (editor-handler/remove-block-property! block-id :heading)
+                         (editor-handler/set-block-property! block-id :heading true)))}
+          (if heading?
+            "Convert back to a block"
+            "Convert to a heading"))
+
+         (block-template block-id)
+
          (if (srs/card-block? block)
            (ui/menu-link
             {:key      "Preview Card"
@@ -228,11 +240,7 @@
              :on-click #(srs/make-block-a-card! block-id)}
             "Make a Card"))
 
-         (ui/menu-link
-          {:key      "Cut"
-           :on-click (fn [_e]
-                       (editor-handler/cut-block! block-id))}
-          "Cut")
+         [:hr.my-1]
 
          (ui/menu-link
           {:key      "Expand all"