🎨 Reorganize the contacts_window widgets + add first interactions with homeserver

This commit is contained in:
2023-08-15 22:05:26 +02:00
parent 22ef914304
commit 2159c6adeb
17 changed files with 712 additions and 243 deletions

View File

@@ -1,4 +1,5 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_desktop::Config;
use dioxus_std::utils::rw::use_rw;
@@ -7,7 +8,7 @@ pub mod components;
pub mod matrix_client;
use crate::base::{AppSettings, Store};
use crate::components::contacts_window::ContactWindow;
use crate::components::contacts_window::contacts_window::ContactsWindow;
use crate::components::login::Login;
mod base;
@@ -15,16 +16,16 @@ mod base;
fn App(cx: Scope<AppSettings>) -> Element {
use_shared_state_provider(cx, || cx.props.clone());
let store = use_rw(cx, || Store::new());
let rw_store = use_rw(cx, || Store::new());
let is_logged = store.read().unwrap().is_logged;
let is_logged = rw_store.read().unwrap().is_logged;
cx.render(rsx! {
if is_logged {
rsx!(ContactWindow {})
rsx!(ContactsWindow {rw_store: rw_store})
}
else {
rsx!(Login {store: store})
rsx!(Login {rw_store: rw_store})
}
})
}