🚧 Add an interface to the ChatsWindows to drive its behavior

For now, only the ChatsWindow tabs are toggled on clicks on room names (from ContactsSection).
This commit is contained in:
2023-12-30 23:31:51 +01:00
parent 2fed770f62
commit 116bbcb247
9 changed files with 208 additions and 92 deletions

View File

@@ -1,14 +1,15 @@
#![allow(non_snake_case)]
pub mod components;
pub mod matrix_interface;
pub mod utils;
use dioxus::prelude::*;
use dioxus_desktop::Config;
use fermi::*;
use tracing::{debug, Level};
pub mod components;
pub mod matrix_interface;
use crate::base::{login, sync_rooms, APP_SETTINGS, ROOMS, SESSION};
use crate::base::{login, sync_rooms, APP_SETTINGS, CHATS_WIN_INTERFACE, ROOMS, SESSION};
use crate::components::chats_window::{ChatsWindow, ChatsWindowProps};
use crate::components::main_window::MainWindow;
@@ -22,6 +23,7 @@ fn App(cx: Scope) -> Element {
let app_settings_ref = use_atom_ref(cx, &APP_SETTINGS);
let session_ref = use_atom_ref(cx, &SESSION);
let rooms_ref = use_atom_ref(cx, &ROOMS);
let chats_win_interface_ref = use_atom_ref(cx, &CHATS_WIN_INTERFACE);
let chats_win_state = use_state(cx, || None);
@@ -55,7 +57,11 @@ fn App(cx: Scope) -> Element {
.borrow()
.receivers
.clone();
let chats_props = ChatsWindowProps { receivers };
let chats_props = ChatsWindowProps {
receivers,
interface: chats_win_interface_ref.clone(),
};
let chats_dom = VirtualDom::new_with_props(ChatsWindow, chats_props);