examples: slightly simplify crm
This commit is contained in:
1 parent
718fa14b45
commit
f07e345eb2
1 file changed
+15
-17
@@ -12,21 +12,7 @@ fn main() {
|
|||||||
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
||||||
|
|
||||||
// Run the app
|
dioxus_web::launch(App, |c| c)
|
||||||
static WrappedApp: FC<()> = |cx, _| {
|
|
||||||
rsx!(cx, body {
|
|
||||||
link {
|
|
||||||
rel: "stylesheet"
|
|
||||||
href: "https://unpkg.com/purecss@2.0.6/build/pure-min.css"
|
|
||||||
integrity: "sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5"
|
|
||||||
crossorigin: "anonymous"
|
|
||||||
}
|
|
||||||
margin_left: "35%"
|
|
||||||
h1 {"Dioxus CRM Example"}
|
|
||||||
App {}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
dioxus_web::launch(WrappedApp, |c| c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Scene {
|
enum Scene {
|
||||||
@@ -50,7 +36,7 @@ static App: FC<()> = |cx, _| {
|
|||||||
let lastname = use_state(cx, || String::new());
|
let lastname = use_state(cx, || String::new());
|
||||||
let description = use_state(cx, || String::new());
|
let description = use_state(cx, || String::new());
|
||||||
|
|
||||||
match *scene {
|
let scene = match *scene {
|
||||||
Scene::ClientsList => {
|
Scene::ClientsList => {
|
||||||
rsx!(cx, div { class: "crm"
|
rsx!(cx, div { class: "crm"
|
||||||
h2 { "List of clients" margin_bottom: "10px" }
|
h2 { "List of clients" margin_bottom: "10px" }
|
||||||
@@ -111,5 +97,17 @@ static App: FC<()> = |cx, _| {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
rsx!(cx, body {
|
||||||
|
link {
|
||||||
|
rel: "stylesheet"
|
||||||
|
href: "https://unpkg.com/purecss@2.0.6/build/pure-min.css"
|
||||||
|
integrity: "sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5"
|
||||||
|
crossorigin: "anonymous"
|
||||||
|
}
|
||||||
|
margin_left: "35%"
|
||||||
|
h1 {"Dioxus CRM Example"}
|
||||||
|
{scene}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user