BlueGit

ict rusty-teams

Files

rusty-teams / crates / app / src / settings / chats.rs

chats.rs

chats.rs 853 B Download Raw
1use gpui_kit::component::v_flex;
2use gpui_kit::*;
3use teams_core::ChatSection;
4
5use super::rows::{caption, toggle_row};
6use crate::app_state::AppState;
7use crate::theme;
8
9pub fn render(app: &Entity<AppState>, cx: &App) -> Div {
10 let enabled = app
11 .read(cx)
12 .directory
13 .section_settings
14 .enabled(ChatSection::Muted);
15 let toggle_app = app.clone();
16 v_flex().w_full().child(caption("CHAT LIST")).child(
17 toggle_row(
18 "settings-muted-section",
19 "Show muted items in their own section",
20 "Read from your Teams account",
21 theme::text_muted(),
22 enabled,
23 )
24 .on_click(move |_, _, cx| {
25 toggle_app.update(cx, |state, cx| {
26 state.set_chat_section(ChatSection::Muted, !enabled, cx)
27 })
28 }),
29 )
30}