🚧 Handle logged state + Login -> ContactsWindow transition
This commit is contained in:
18
src/main.rs
18
src/main.rs
@@ -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]
|
||||
|
Reference in New Issue
Block a user