🎨 Reorganize the contacts_window widgets + add first interactions with homeserver
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user