incorporate PR review feedback

pull/3010/head^2
Devon Zuegel 2021-10-27 16:46:00 -04:00 committed by Tienson Qin
parent 5221eb0572
commit e3c87fa232
1 changed files with 13 additions and 2 deletions

View File

@ -91,6 +91,16 @@
:page-presentation
{:page page}))}}
;; TODO: In the future, we'd like to extract file-related actions
;; (such as open-in-finder & open-with-default-app) into a sub-menu of
;; this one. However this component doesn't yet exist. PRs are welcome!
;; Details: https://github.com/logseq/logseq/pull/3003#issuecomment-952820676
(when-let [file-path (and (util/electron?) (page-handler/get-page-file-path))]
[{:title (t :page/open-in-finder)
:options {:on-click #(js/window.apis.showItemInFolder file-path)}}
{:title (t :page/open-with-default-app)
:options {:on-click #(js/window.apis.openPath file-path)}}])
(when-not contents?
{:title (t :page/delete)
:options {:on-click #(state/set-modal! (delete-page-dialog page-name))}})
@ -131,8 +141,9 @@
[:div
[:pre.code page-data]
[:br]
(ui/button "Copy to clipboard"
:on-click #(.writeText js/navigator.clipboard page-data))]
(ui/button
"Copy to clipboard"
:on-click #(.writeText js/navigator.clipboard page-data))]
:success
false)))}})]
(flatten)