initial post box view

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-06-14 12:16:49 -07:00
parent 577aa76ac7
commit 1458498131
17 changed files with 181 additions and 25 deletions

View File

@@ -20,6 +20,17 @@ impl<'cache, 'url> ProfilePic<'cache, 'url> {
ProfilePic { cache, url, size }
}
pub fn from_profile(
cache: &'cache mut ImageCache,
profile: &nostrdb::ProfileRecord<'url>,
) -> Option<Self> {
if let Some(url) = profile.record().profile().and_then(|p| p.picture()) {
Some(ProfilePic::new(cache, url))
} else {
None
}
}
pub fn default_size() -> f32 {
38.0
}