chore: follow up on #151 (#152)

* improve ui

* .

* clean up
This commit is contained in:
reya
2025-09-15 20:53:25 +07:00
committed by GitHub
parent d13ffd5a54
commit 9880a3ed3d
3 changed files with 23 additions and 14 deletions

BIN
assets/brand/system.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -436,11 +436,6 @@ impl ChatSpace {
} else {
css.signal.send(SignalKind::RelaysNotFound).await;
}
} else {
for (id, relays) in client.subscriptions().await {
log::info!("sub id: {id:?}");
log::info!("relays: {relays:?}");
}
}
}
Kind::ContactList => {

View File

@@ -395,6 +395,7 @@ impl Chat {
cx.spawn_in(window, async move |this, cx| {
match task.await {
Ok(reports) => {
if !reports.is_empty() {
this.update(cx, |this, cx| {
this.reports_by_id.entry(id_clone).and_modify(|this| {
*this = reports;
@@ -403,6 +404,7 @@ impl Chat {
})
.ok();
}
}
Err(e) => {
cx.update(|window, cx| {
window.push_notification(e.to_string(), cx);
@@ -643,17 +645,28 @@ impl Chat {
fn render_warning(&mut self, ix: usize, content: String, cx: &mut Context<Self>) -> AnyElement {
div()
.id(ix)
.relative()
.w_full()
.py_1()
.px_3()
.bg(cx.theme().warning_background)
.child(
h_flex()
.gap_3()
.text_sm()
.text_color(cx.theme().warning_foreground)
.child(Avatar::new("brand/avatar.png").size(rems(2.)))
.child(Avatar::new("brand/system.png").size(rems(2.)))
.child(SharedString::from(content)),
)
.child(
div()
.absolute()
.left_0()
.top_0()
.w(px(2.))
.h_full()
.bg(cx.theme().warning_active),
)
.into_any_element()
}
@@ -704,7 +717,8 @@ impl Chat {
.py_1()
.px_3()
.child(
h_flex()
div()
.flex()
.gap_3()
.when(!hide_avatar, |this| {
this.child(Avatar::new(author.avatar_url(proxy)).size(rems(2.)))