diff --git a/crates/notedeck/src/profile/context.rs b/crates/notedeck/src/profile/context.rs new file mode 100644 index 0000000..f5fc4f0 --- /dev/null +++ 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 index f173151..93d3ee9 100644 --- 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};