From 119f64b29c0147f86f63e18e14818c41e4bdefdd Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 30 Aug 2023 09:59:52 +0530 Subject: populating menu from a vector now --- src/app/home/mod.rs | 49 +++++++++++++++++++++-------------------- src/app/manage/mod.rs | 60 +++++++++++++++++++++++++-------------------------- 2 files changed, 53 insertions(+), 56 deletions(-) (limited to 'src/app') 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! {
@@ -30,31 +53,7 @@ pub fn home_page() -> Html {

{ "Welcome To OpenBills!" }

- - - - - - - - - +
} 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! {
@@ -31,37 +59,7 @@ pub fn manage_menu_page() -> Html {

{ "Here you can add/modify/delete OpenBills data (clients, invoices, etc)" }

- - - - - - - - - - - +
} -- cgit v1.2.3