notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 6d426cf2c4731fca98cd37547d8d291b5047d037
parent d8e027490ce0c2ad8a08a0f75702a4311522838c
Author: kernelkind <kernelkind@gmail.com>
Date:   Sun,  5 Oct 2025 15:35:18 -0400

add `ProfileContext`

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Acrates/notedeck/src/profile/context.rs | 20++++++++++++++++++++
Mcrates/notedeck/src/profile/mod.rs | 2++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/crates/notedeck/src/profile/context.rs b/crates/notedeck/src/profile/context.rs @@ -0,0 +1,20 @@ +use enostr::Pubkey; + +pub enum ProfileContextSelection { + CopyLink, +} + +pub struct ProfileContext { + pub profile: Pubkey, + pub selection: ProfileContextSelection, +} + +impl ProfileContextSelection { + pub fn process(&self, ctx: &egui::Context, pk: &Pubkey) { + let Some(npub) = pk.npub() else { + return; + }; + + ctx.copy_text(format!("https://damus.io/{npub}")); + } +} diff --git a/crates/notedeck/src/profile/mod.rs b/crates/notedeck/src/profile/mod.rs @@ -1,3 +1,5 @@ +mod context; mod url; +pub use context::{ProfileContext, ProfileContextSelection}; pub use url::{get_profile_url, no_pfp_url, unwrap_profile_url};