chore: refine some ui components (#38)

Reviewed-on: https://git.reya.su/reya/coop/pulls/38
This commit was merged in pull request #38.
This commit is contained in:
2026-08-01 10:38:08 +00:00
parent b0d1521c49
commit fbf06f2c81
27 changed files with 141 additions and 245 deletions
+1 -9
View File
@@ -5,8 +5,6 @@ use gpui::SharedString;
use nostr_sdk::prelude::*;
use state::Announcement;
const IMAGE_RESIZER: &str = "https://wsrv.nl";
/// Person
#[derive(Debug, Clone)]
pub struct Person {
@@ -111,13 +109,7 @@ impl Person {
.picture
.as_ref()
.filter(|picture| !picture.is_empty())
.map(|picture| {
let encoded_picture = urlencoding::encode(picture);
let url = format!(
"{IMAGE_RESIZER}/?url={encoded_picture}&w=100&h=100&fit=cover&mask=circle&n=-1"
);
url.into()
})
.map(|picture| picture.into())
.unwrap_or_else(|| "brand/avatar.png".into())
}