diff --git a/web/src/components/header.rs b/web/src/components/header.rs index 438c866..15e93af 100644 --- a/web/src/components/header.rs +++ b/web/src/components/header.rs @@ -27,7 +27,7 @@ pub fn Header<'ctx, G: Html>(cx: Scope<'ctx>, h: StateHandler<'ctx>) -> View h1(class="title") { "Kitchen" } ul { li { a(href="/ui/planning/plan") { "MealPlan" } } - li { a(href="/ui/manage/categories") { "Manage" } } + li { a(href="/ui/manage/ingredients") { "Manage" } } li { a(href="/ui/login") { (login.get()) } } } } diff --git a/web/src/pages/manage/categories.rs b/web/src/pages/manage/ingredients.rs similarity index 84% rename from web/src/pages/manage/categories.rs rename to web/src/pages/manage/ingredients.rs index fb46e92..16ca874 100644 --- a/web/src/pages/manage/categories.rs +++ b/web/src/pages/manage/ingredients.rs @@ -17,10 +17,10 @@ use crate::{app_state::StateHandler, components::categories::*}; use sycamore::prelude::*; #[component()] -pub fn CategoryPage<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View { +pub fn IngredientsPage<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View { view! {cx, ManagePage( - selected=Some("Categories".to_owned()), + selected=Some("Ingredients".to_owned()), ) { Categories(sh) } } } diff --git a/web/src/pages/manage/mod.rs b/web/src/pages/manage/mod.rs index c0c31ff..857b85c 100644 --- a/web/src/pages/manage/mod.rs +++ b/web/src/pages/manage/mod.rs @@ -15,11 +15,11 @@ use crate::components::tabs::*; use sycamore::prelude::*; pub mod add_recipe; -pub mod categories; +pub mod ingredients; pub mod staples; pub use add_recipe::*; -pub use categories::*; +pub use ingredients::*; pub use staples::*; #[derive(Props)] @@ -33,7 +33,7 @@ pub fn ManagePage<'a, G: Html>(cx: Scope<'a>, state: PageState<'a, G>) -> View = vec![ - ("/ui/manage/categories".to_owned(), "Categories"), + ("/ui/manage/ingredients".to_owned(), "Ingredients"), ("/ui/manage/staples".to_owned(), "Staples"), ("/ui/manage/new_recipe".to_owned(), "New Recipe"), ]; diff --git a/web/src/routing/mod.rs b/web/src/routing/mod.rs index fbc0169..d96d72e 100644 --- a/web/src/routing/mod.rs +++ b/web/src/routing/mod.rs @@ -49,8 +49,11 @@ pub enum RecipeRoutes { pub enum ManageRoutes { #[to("/new_recipe")] NewRecipe, + // TODO(jwall): This route is now deprecated. Remove when safe to do so. #[to("/categories")] Categories, + #[to("/ingredients")] + Ingredients, #[to("/staples")] Staples, #[not_found] @@ -99,7 +102,10 @@ fn route_switch<'ctx, G: Html>(route: &Routes, cx: Scope<'ctx>, sh: StateHandler RecipeEditPage(recipe=id.clone(), sh=sh) }, Routes::Manage(Categories) => view! {cx, - CategoryPage(sh) + IngredientsPage(sh) + }, + Routes::Manage(Ingredients) => view! {cx, + IngredientsPage(sh) }, Routes::Manage(NewRecipe) => view! {cx, AddRecipePage(sh)