Fix generational box in release mode

This commit is contained in:
Jonathan Kelley committed 2024-01-21 12:46:19 -08:00
1 parent 06d9b575b7
commit 028f499bf6
10 files changed
+182 -34

No files matched your search

+9 -9
View File
@@ -36,21 +36,21 @@ struct Client {
#[derive(Routable, Clone)]
enum Route {
#[route("/")]
ClientList {},
ClientList,
#[route("/new")]
ClientAdd {},
ClientAdd,
#[route("/settings")]
Settings {},
Settings,
}
#[component]
fn ClientList() -> Element {
rsx! {
h2 { "List of Clients" }
Link { to: Route::ClientAdd {}, class: "pure-button pure-button-primary", "Add Client" }
Link { to: Route::Settings {}, class: "pure-button", "Settings" }
Link { to: Route::ClientAdd, class: "pure-button pure-button-primary", "Add Client" }
Link { to: Route::Settings, class: "pure-button", "Settings" }
for client in CLIENTS.read().iter() {
div { class: "client", style: "margin-bottom: 50px",
p { "Name: {client.first_name} {client.last_name}" }
@@ -75,7 +75,7 @@ fn ClientAdd() -> Element {
});
// And then navigate back to the client list
dioxus::router::router().push(Route::ClientList {});
dioxus::router::router().push(Route::ClientList);
};
rsx! {
@@ -121,7 +121,7 @@ fn ClientAdd() -> Element {
div { class: "pure-controls",
button { r#type: "submit", class: "pure-button pure-button-primary", "Save" }
Link { to: Route::ClientList {}, class: "pure-button pure-button-primary red", "Cancel" }
Link { to: Route::ClientList, class: "pure-button pure-button-primary red", "Cancel" }
}
}
}
@@ -136,10 +136,10 @@ fn Settings() -> Element {
class: "pure-button pure-button-primary red",
onclick: move |_| {
CLIENTS.write().clear();
dioxus::router::router().push(Route::ClientList {});
dioxus::router::router().push(Route::ClientList);
},
"Remove all Clients"
}
Link { to: Route::ClientList {}, class: "pure-button", "Go back" }
Link { to: Route::ClientList, class: "pure-button", "Go back" }
}
}