aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/navbar/nav.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/components/navbar/nav.rs b/src/components/navbar/nav.rs
index dd215a0..5249b60 100644
--- a/src/components/navbar/nav.rs
+++ b/src/components/navbar/nav.rs
@@ -17,6 +17,7 @@
use yew::prelude::*;
use yew_router::prelude::*;
+use gloo::utils::document;
use crate::app::Route;
use crate::components::navbar::nav_link::NavLink;
@@ -58,8 +59,8 @@ pub fn nav() -> Html {
to: Route::Home,
},
Link {
- label: String::from("Clients"),
- to: Route::ManageClients,
+ label: String::from("Customers"),
+ to: Route::ManageCustomers,
},
Link {
label: String::from("Brands"),
@@ -76,7 +77,7 @@ pub fn nav() -> Html {
]);
let links_html: Html = match current_route {
- Route::ManageClients
+ Route::ManageCustomers
| Route::ManageBrands
| Route::ManageItems
| Route::ManageInvoices => manage_links,
@@ -86,6 +87,19 @@ pub fn nav() -> Html {
.map(|link| html!(<NavLink label={link.label.clone()} to={link.to.clone()} />))
.collect();
+ // set document title
+ document().set_title(match current_route {
+ Route::Home => "",
+
+ Route::ManageMenu => "Manage OpenBills Data",
+ Route::ManageCustomers => "Manage OpenBills Customers",
+ Route::ManageBrands => "Manage OpenBills Brands",
+ Route::ManageItems => "Manage OpenBills Items",
+ Route::ManageInvoices => "Manage OpenBills Invoices",
+
+ _ => "Hello World",
+ });
+
html! {
<nav>
{links_html}