From cc66c1f4f515dff52c91108501fce9a77fff8c7c Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sat, 28 Sep 2024 09:49:08 -0400 Subject: [PATCH] dev: refactor out into more composable pieces --- web/src/components/shopping_list.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/src/components/shopping_list.rs b/web/src/components/shopping_list.rs index c83d5bf..896e4d6 100644 --- a/web/src/components/shopping_list.rs +++ b/web/src/components/shopping_list.rs @@ -297,7 +297,16 @@ fn make_shopping_table<'ctx, G: Html>( (make_extras_rows(cx, sh)) } } - ("Deleted Items") + } +} + +fn make_deleted_items_table<'ctx, G: Html>( + cx: Scope<'ctx>, + sh: StateHandler<'ctx>, + show_staples: &'ctx ReadSignal, +) -> View { + view! {cx, + h2 { "Deleted Items" } table(class="pad-top shopping-list page-breaker container-fluid", role="grid") { tr { th { " Quantity " } @@ -324,6 +333,7 @@ pub fn ShoppingList<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> V sh.dispatch(cx, Message::UpdateUseStaples(value)); }) (make_shopping_table(cx, sh, show_staples)) + (make_deleted_items_table(cx, sh, show_staples)) button(class="no-print", on:click=move |_| { info!("Registering add item request for inventory"); sh.dispatch(cx, Message::AddExtra(String::new(), String::new()));