add ProfileContext

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-10-05 15:35:18 -04:00
parent d8e027490c
commit 6d426cf2c4
2 changed files with 22 additions and 0 deletions

View File

@@ -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}"));
}
}

View File

@@ -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};