mirror of https://github.com/logseq/logseq
enhance(ui): refactor the context menu with the shui dropdown menu items
parent
d0866fe4de
commit
1e13b67ab0
|
@ -353,29 +353,29 @@
|
||||||
(rum/defc block-ref-custom-context-menu-content
|
(rum/defc block-ref-custom-context-menu-content
|
||||||
[block block-ref-id]
|
[block block-ref-id]
|
||||||
(when (and block block-ref-id)
|
(when (and block block-ref-id)
|
||||||
[:.menu-links-wrapper
|
[:<>
|
||||||
(ui/menu-link
|
(shui/dropdown-menu-item
|
||||||
{:key "open-in-sidebar"
|
{:key "open-in-sidebar"
|
||||||
:on-click (fn []
|
:on-click (fn []
|
||||||
(state/sidebar-add-block!
|
(state/sidebar-add-block!
|
||||||
(state/get-current-repo)
|
(state/get-current-repo)
|
||||||
block-ref-id
|
block-ref-id
|
||||||
:block-ref))
|
:block-ref))}
|
||||||
:shortcut ["⇧+click"]}
|
(t :content/open-in-sidebar)
|
||||||
(t :content/open-in-sidebar))
|
(shui/dropdown-menu-shortcut ["⇧+click"]))
|
||||||
(ui/menu-link
|
(shui/dropdown-menu-item
|
||||||
{:key "copy"
|
{:key "copy"
|
||||||
:on-click (fn [] (editor-handler/copy-current-ref block-ref-id))}
|
:on-click (fn [] (editor-handler/copy-current-ref block-ref-id))}
|
||||||
(t :content/copy-ref))
|
(t :content/copy-ref))
|
||||||
(ui/menu-link
|
(shui/dropdown-menu-item
|
||||||
{:key "delete"
|
{:key "delete"
|
||||||
:on-click (fn [] (editor-handler/delete-current-ref! block block-ref-id))}
|
:on-click (fn [] (editor-handler/delete-current-ref! block block-ref-id))}
|
||||||
(t :content/delete-ref))
|
(t :content/delete-ref))
|
||||||
(ui/menu-link
|
(shui/dropdown-menu-item
|
||||||
{:key "replace-with-text"
|
{:key "replace-with-text"
|
||||||
:on-click (fn [] (editor-handler/replace-ref-with-text! block block-ref-id))}
|
:on-click (fn [] (editor-handler/replace-ref-with-text! block block-ref-id))}
|
||||||
(t :content/replace-with-text))
|
(t :content/replace-with-text))
|
||||||
(ui/menu-link
|
(shui/dropdown-menu-item
|
||||||
{:key "replace-with-embed"
|
{:key "replace-with-embed"
|
||||||
:on-click (fn [] (editor-handler/replace-ref-with-embed! block block-ref-id))}
|
:on-click (fn [] (editor-handler/replace-ref-with-embed! block block-ref-id))}
|
||||||
(t :content/replace-with-embed))]))
|
(t :content/replace-with-embed))]))
|
||||||
|
|
Loading…
Reference in New Issue