remove unneeded menu options when publishing

pull/9288/head^2
Lina 2023-04-27 20:37:03 +00:00 committed by Gabriel Horner
parent 70f2ab1e98
commit cfd38a3cee
2 changed files with 16 additions and 12 deletions

View File

@ -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) ")")

View File

@ -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))}})