Browse Source

remove unneeded menu options when publishing

Lina 2 years ago
parent
commit
cfd38a3cee
2 changed files with 16 additions and 12 deletions
  1. 12 10
      src/main/frontend/components/header.cljs
  2. 4 2
      src/main/frontend/components/page_menu.cljs

+ 12 - 10
src/main/frontend/components/header.cljs

@@ -114,17 +114,19 @@
           :options {:href (rfe/href :import)}
           :icon (ui/icon "file-upload")})
 
-       {:title [:div.flex-row.flex.justify-between.items-center
-                [:span (t :join-community)]]
-        :options {:href "https://discuss.logseq.com"
-                  :title (t :discourse-title)
-                  :target "_blank"}
-        :icon (ui/icon "brand-discord")}
+       (when-not config/publishing? 
+         {:title [:div.flex-row.flex.justify-between.items-center
+                  [:span (t :join-community)]]
+          :options {:href "https://discuss.logseq.com"
+                    :title (t :discourse-title)
+                    :target "_blank"}
+          :icon (ui/icon "brand-discord")})
 
-       {:title [:div.flex-row.flex.justify-between.items-center
-                [:span (t :help/bug)]]
-        :options {:href (rfe/href :bug-report)}
-        :icon (ui/icon "bug")}
+       (when-not config/publishing?
+         {:title [:div.flex-row.flex.justify-between.items-center
+                  [:span (t :help/bug)]]
+          :options {:href (rfe/href :bug-report)}
+          :icon (ui/icon "bug")})
 
        (when (and (state/sub :auth/id-token) (user-handler/logged-in?))
          {:title (str (t :logout) " (" (user-handler/email) ")")

+ 4 - 2
src/main/frontend/components/page_menu.cljs

@@ -78,7 +78,8 @@
           file-sync-graph-uuid (and (user-handler/logged-in?)
                                     (file-sync-handler/enable-sync?)
                                     (file-sync-handler/get-current-graph-uuid))]
-      (when (and page (not block?))
+      (when (and page (not (or (block?)
+                               (config/publishing?))))
         (->>
          [{:title   (if favorited?
                       (t :page/unfavorite)
@@ -109,7 +110,8 @@
             {:title   (t :page/copy-page-url)
              :options {:on-click #(page-handler/copy-page-url page-original-name)}})
 
-          (when-not contents?
+          (when-not (or (contents?) 
+                        (config/publishing?))
             {:title   (t :page/delete)
              :options {:on-click #(state/set-modal! (delete-page-dialog page-name))}})