From ac7d114c238b9d189e12229e6065f3a532725d78 Mon Sep 17 00:00:00 2001 From: dtonon Date: Wed, 28 Aug 2024 19:57:15 +0200 Subject: [PATCH] Move the web sharing outside the copy menu --- gossip-bin/src/ui/feed/note/mod.rs | 36 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/gossip-bin/src/ui/feed/note/mod.rs b/gossip-bin/src/ui/feed/note/mod.rs index e49d901c..82af7c46 100644 --- a/gossip-bin/src/ui/feed/note/mod.rs +++ b/gossip-bin/src/ui/feed/note/mod.rs @@ -1463,6 +1463,24 @@ fn note_actions( ))); } // end Bookmark + // ---- Share ---- + if !note.event.kind.is_direct_message_related() { + items.push(MoreMenuItem::Button(MoreMenuButton::new( + "Share via web", + Box::new(|ui, _| { + let nevent = NEvent { + id: note.event.id, + relays: relays.clone(), + author: None, + kind: None, + }; + ui.output_mut(|o| { + o.copied_text = format!("https://njump.me/{}", nevent.as_bech32_string()) + }); + }), + ))); + } // end Share + // ---- Copy ID SubMenu ---- { // put all copy buttons in a submenu @@ -1502,22 +1520,6 @@ fn note_actions( }), ))); } - if !note.event.kind.is_direct_message_related() { - copy_items.push(MoreMenuItem::Button(MoreMenuButton::new( - "as web link", - Box::new(|ui, _| { - let nevent = NEvent { - id: note.event.id, - relays: relays.clone(), - author: None, - kind: None, - }; - ui.output_mut(|o| { - o.copied_text = format!("https://njump.me/{}", nevent.as_bech32_string()) - }); - }), - ))); - } copy_items.push(MoreMenuItem::Button(MoreMenuButton::new( "as note1", Box::new(|ui, _| { @@ -1533,7 +1535,7 @@ fn note_actions( ))); items.push(MoreMenuItem::SubMenu(MoreMenuSubMenu::new( - "Copy ID", copy_items, &menu, + "Copy event ID", copy_items, &menu, ))); } // end Copy ID SubMenu