diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-30 09:59:52 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-30 09:59:52 +0530 |
commit | 119f64b29c0147f86f63e18e14818c41e4bdefdd (patch) | |
tree | 4acda4661cb30cdf00aecb588090e2e94f8bef72 /src/app/home | |
parent | 887cd8d28ba8c6f462f4ad7d4aca99bbd7e145b1 (diff) |
populating menu from a vector now
Diffstat (limited to 'src/app/home')
-rw-r--r-- | src/app/home/mod.rs | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/src/app/home/mod.rs b/src/app/home/mod.rs index 71f3a58..2d792aa 100644 --- a/src/app/home/mod.rs +++ b/src/app/home/mod.rs @@ -23,6 +23,29 @@ use crate::components::navigation_menu::*; #[function_component(HomePage)] pub fn home_page() -> Html { + let page_menu_items = Vec::from([ + menu_items::Item { + icon: IconId::FontAwesomeSolidPlus, + label: String::from("Create New Invoice"), + to: Route::NewInvoice, + }, + menu_items::Item { + icon: IconId::FontAwesomeSolidMagnifyingGlass, + label: String::from("View Invoices"), + to: Route::ViewInvoices, + }, + menu_items::Item { + icon: IconId::FontAwesomeSolidMountainSun, + label: String::from("Manage Data"), + to: Route::ManageMenu, + }, + menu_items::Item { + icon: IconId::FontAwesomeSolidGear, + label: String::from("Settings"), + to: Route::Settings, + }, + ]); + html! { <div id={"home-page"}> <NavigationMenu> @@ -30,31 +53,7 @@ pub fn home_page() -> Html { <h1>{ "Welcome To OpenBills!" }</h1> </menu_header::MenuHeader> - <menu_items::MenuItems> - <menu_item::MenuItem - icon={IconId::FontAwesomeSolidPlus} - label={"Create New Invoice"} - to={Route::NewInvoice} - /> - - <menu_item::MenuItem - icon={IconId::FontAwesomeSolidMagnifyingGlass} - label={"View Invoices"} - to={Route::ViewInvoices} - /> - - <menu_item::MenuItem - icon={IconId::FontAwesomeSolidMountainSun} - label={"Manage Data"} - to={Route::ManageMenu} - /> - - <menu_item::MenuItem - icon={IconId::FontAwesomeSolidGear} - label={"Settings"} - to={Route::Settings} - /> - </menu_items::MenuItems> + <menu_items::MenuItems items={page_menu_items}/> </NavigationMenu> </div> } |