Skip to content

Commit

Permalink
Merge remote-tracking branch 'dtonon/move-web-share' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Sep 10, 2024
2 parents 3926bde + ac7d114 commit 64ae9a4
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions gossip-bin/src/ui/feed/note/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, _| {
Expand All @@ -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

Expand Down

0 comments on commit 64ae9a4

Please sign in to comment.