mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
examples: slightly simplify crm
This commit is contained in:
parent
718fa14b45
commit
f07e345eb2
1 changed files with 15 additions and 17 deletions
|
@ -12,21 +12,7 @@ fn main() {
|
|||
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// Run the app
|
||||
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)
|
||||
dioxus_web::launch(App, |c| c)
|
||||
}
|
||||
|
||||
enum Scene {
|
||||
|
@ -50,7 +36,7 @@ static App: FC<()> = |cx, _| {
|
|||
let lastname = use_state(cx, || String::new());
|
||||
let description = use_state(cx, || String::new());
|
||||
|
||||
match *scene {
|
||||
let scene = match *scene {
|
||||
Scene::ClientsList => {
|
||||
rsx!(cx, div { class: "crm"
|
||||
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}
|
||||
})
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue