🚧 Handle logged state + Login -> ContactsWindow transition

This commit is contained in:
2023-08-05 20:17:05 +02:00
parent 45d5eb704c
commit a380c42b03
6 changed files with 81 additions and 30 deletions

View File

@@ -17,6 +17,8 @@ mod base;
fn App(cx: Scope<AppSettings>) -> Element {
use_shared_state_provider(cx, || cx.props.clone());
let app_context = use_shared_state::<AppSettings>(cx).unwrap();
global_css!(
"
body {
@@ -70,11 +72,17 @@ fn App(cx: Scope<AppSettings>) -> Element {
// let dom = VirtualDom::new(ControlWindow);
// window.new_window(dom, cx.props.clone());
cx.render(rsx! {
AppStyle {},
// Login {}
ContactWindow {}
})
if app_context.read().store.is_logged {
cx.render(rsx! {
AppStyle {},
ContactWindow {},
})
} else {
cx.render(rsx! {
AppStyle {},
Login {}
})
}
}
#[tokio::main]