mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 09:34:19 +01:00
20
crates/notedeck/src/profile/context.rs
Normal file
20
crates/notedeck/src/profile/context.rs
Normal 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}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
mod context;
|
||||||
mod url;
|
mod url;
|
||||||
|
|
||||||
|
pub use context::{ProfileContext, ProfileContextSelection};
|
||||||
pub use url::{get_profile_url, no_pfp_url, unwrap_profile_url};
|
pub use url::{get_profile_url, no_pfp_url, unwrap_profile_url};
|
||||||
|
|||||||
Reference in New Issue
Block a user