diff --git a/build.rs b/build.rs index 80f3543..7d0ad5a 100644 --- a/build.rs +++ b/build.rs @@ -15,26 +15,27 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let mut tasks = Vec::new(); - - // Global tokens - tasks.push(Task::new( - PathBuf::from("src/ui/_base.scss"), - Path::new(&out_dir).join("style_tokens.rs"), - "style".to_string(), - )); - // variables defined by the Panel component - tasks.push(Task::new( - PathBuf::from("src/ui/components/_panel.scss"), - Path::new(&out_dir).join("style_component_panel.rs"), - "panel".to_string(), - )); - // Variables set by the Conversations layout - tasks.push(Task::new( - PathBuf::from("src/ui/layouts/conversations.scss"), - Path::new(&out_dir).join("style_layout_conversations.rs"), - "conversations".to_string(), - )); + // let mut tasks = Vec::new(); + let tasks = vec![ + // Global tokens + Task::new( + PathBuf::from("src/ui/_base.scss"), + Path::new(&out_dir).join("style_tokens.rs"), + "style".to_string(), + ), + // variables defined by the Panel component + Task::new( + PathBuf::from("src/ui/components/_panel.scss"), + Path::new(&out_dir).join("style_component_panel.rs"), + "panel".to_string(), + ), + // Variables set by the Conversations layout + Task::new( + PathBuf::from("src/ui/layouts/conversations.scss"), + Path::new(&out_dir).join("style_layout_conversations.rs"), + "conversations".to_string(), + ), + ]; export_variables(tasks) } diff --git a/src/domain/model/store_interface.rs b/src/domain/model/store_interface.rs index 4a30354..bfdd944 100644 --- a/src/domain/model/store_interface.rs +++ b/src/domain/model/store_interface.rs @@ -39,6 +39,7 @@ pub trait RoomStoreConsumerInterface { pub trait RoomStoreProviderInterface { fn on_new_name(&self, name: Option); fn on_new_avatar(&self, avatar: Option); + #[allow(dead_code)] fn on_new_topic(&self, topic: Option); fn on_new_member(&self, member: RoomMember); fn on_invitation(&self, invitation: Invitation); diff --git a/src/ui/components/chat_panel.rs b/src/ui/components/chat_panel.rs index 0ba0b6c..868adc3 100644 --- a/src/ui/components/chat_panel.rs +++ b/src/ui/components/chat_panel.rs @@ -5,7 +5,7 @@ turf::style_sheet!("src/ui/components/chat_panel.scss"); #[component] pub fn ChatPanel(name: String) -> Element { rsx! { - style { {STYLE_SHEET} }, + style { {STYLE_SHEET} } div { class: ClassName::CHAT_PANEL, diff --git a/src/ui/components/conversations.rs b/src/ui/components/conversations.rs index ee71bdd..f572685 100644 --- a/src/ui/components/conversations.rs +++ b/src/ui/components/conversations.rs @@ -237,12 +237,16 @@ pub fn ConversationAvatar( let on_press = { let room_id = room_id.clone(); move || { - on_selected.map(|c| c.call(room_id.as_ref().clone())); + if let Some(c) = on_selected { + c.call(room_id.as_ref().clone()) + } } }; let on_long_press = move || { - on_pressed.map(|c| c.call(room_id.as_ref().clone())); + if let Some(c) = on_pressed { + c.call(room_id.as_ref().clone()) + } }; let long_press_hook = use_long_press(long_press_duration, on_press, on_long_press);