refactor: split native app root by screen

This commit is contained in:
ZacharyZhang-NY committed 2026-04-19 01:32:40 -04:00
1 parent 6508e75a62
commit 5097591725
12 files changed
+964 -712

No files matched your search

@@ -0,0 +1,57 @@
use super::*;
impl AppRoot {
pub(super) fn render_inbox(&self) -> impl IntoElement + '_ {
div()
.flex()
.gap_4()
.child(
div()
.flex_1()
.p_4()
.gap_2()
.border_1()
.rounded_md()
.border_color(rgb(0xd9cdbf))
.bg(rgb(0xfffbf5))
.child(div().text_lg().child("Unread messages"))
.children(
self.snapshot
.agent_messages
.iter()
.filter(|item| item.read_at.is_none())
.take(8)
.map(|item| {
div()
.py_2()
.border_b_1()
.border_color(rgb(0xeee3d7))
.child(format!("{} · {}", item.subject, item.body))
}),
),
)
.child(
div()
.flex_1()
.p_4()
.gap_2()
.border_1()
.rounded_md()
.border_color(rgb(0xd9cdbf))
.bg(rgb(0xfffbf5))
.child(div().text_lg().child("Pending approvals"))
.children(
self.snapshot
.approvals
.iter()
.filter(|item| item.state == "pending")
.take(8)
.map(|item| {
div().py_2().border_b_1().border_color(rgb(0xeee3d7)).child(
format!("{} · {}", item.approval_type, item.payload_summary),
)
}),
),
)
}
}