remove app from sidebar

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-09-24 16:00:21 -04:00
parent 0ea3132ee2
commit 2832def161
3 changed files with 47 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
use crate::app_style::NotedeckTextStyle;
use crate::imgcache::ImageCache;
use crate::ui::ProfilePic;
use crate::user_account::UserAccount;
use crate::{colors, images, DisplayName};
use egui::load::TexturePoll;
use egui::{Frame, RichText, Sense, Widget};
@@ -175,6 +176,22 @@ pub fn get_profile_url_owned(profile: Option<ProfileRecord<'_>>) -> &str {
}
}
pub fn get_account_url<'a>(
txn: &'a nostrdb::Transaction,
ndb: &nostrdb::Ndb,
account: Option<&UserAccount>,
) -> &'a str {
if let Some(selected_account) = account {
if let Ok(profile) = ndb.get_profile_by_pubkey(txn, selected_account.pubkey.bytes()) {
get_profile_url_owned(Some(profile))
} else {
get_profile_url_owned(None)
}
} else {
get_profile_url(None)
}
}
fn display_name_widget(
display_name: DisplayName<'_>,
add_placeholder_space: bool,