aboutsummaryrefslogtreecommitdiff
path: root/src/app/manage
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-30 09:59:52 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-30 09:59:52 +0530
commit119f64b29c0147f86f63e18e14818c41e4bdefdd (patch)
tree4acda4661cb30cdf00aecb588090e2e94f8bef72 /src/app/manage
parent887cd8d28ba8c6f462f4ad7d4aca99bbd7e145b1 (diff)
populating menu from a vector now
Diffstat (limited to 'src/app/manage')
-rw-r--r--src/app/manage/mod.rs60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/app/manage/mod.rs b/src/app/manage/mod.rs
index 17b7b16..bdca731 100644
--- a/src/app/manage/mod.rs
+++ b/src/app/manage/mod.rs
@@ -23,6 +23,34 @@ use crate::components::navigation_menu::*;
#[function_component(ManageMenuPage)]
pub fn manage_menu_page() -> Html {
+ let page_menu_items = Vec::from([
+ menu_items::Item {
+ icon: IconId::FontAwesomeSolidUser,
+ label: String::from("Edit Clients"),
+ to: Route::ManageClients,
+ },
+ menu_items::Item {
+ icon: IconId::FontAwesomeSolidIndustry,
+ label: String::from("Edit Brands"),
+ to: Route::ManageBrands,
+ },
+ menu_items::Item {
+ icon: IconId::FontAwesomeSolidCartShopping,
+ label: String::from("Edit Items"),
+ to: Route::ManageItems,
+ },
+ menu_items::Item {
+ icon: IconId::FontAwesomeSolidFileInvoice,
+ label: String::from("Edit Invoices"),
+ to: Route::ManageInvoices,
+ },
+ menu_items::Item {
+ icon: IconId::FontAwesomeSolidHouseChimney,
+ label: String::from("Home"),
+ to: Route::Home,
+ },
+ ]);
+
html! {
<div id={"manage-menu-page"}>
<NavigationMenu>
@@ -31,37 +59,7 @@ pub fn manage_menu_page() -> Html {
<p>{ "Here you can add/modify/delete OpenBills data (clients, invoices, etc)" }</p>
</menu_header::MenuHeader>
- <menu_items::MenuItems>
- <menu_item::MenuItem
- icon={IconId::FontAwesomeSolidUser}
- label={"Edit Clients"}
- to={Route::ManageClients}
- />
-
- <menu_item::MenuItem
- icon={IconId::FontAwesomeSolidIndustry}
- label={"Edit Brands"}
- to={Route::ManageBrands}
- />
-
- <menu_item::MenuItem
- icon={IconId::FontAwesomeSolidCartShopping}
- label={"Edit Items"}
- to={Route::ManageItems}
- />
-
- <menu_item::MenuItem
- icon={IconId::FontAwesomeSolidFileInvoice}
- label={"Edit Invoices"}
- to={Route::ManageInvoices}
- />
-
- <menu_item::MenuItem
- icon={IconId::FontAwesomeSolidHouseChimney}
- label={"Home"}
- to={Route::Home}
- />
- </menu_items::MenuItems>
+ <menu_items::MenuItems items={page_menu_items}/>
</NavigationMenu>
</div>
}