Remove root page from the routes

This commit is contained in:
Jeremy Wall 2022-02-15 22:30:18 -05:00
parent 4eaf2ff36b
commit b4f04a2b04
2 changed files with 5 additions and 12 deletions

View File

@ -18,9 +18,7 @@ use sycamore::prelude::*;
pub fn header() -> View<G> {
view! {
div(class="menu") {
span { a(href="/ui/") { "Home" }}
" | "
span { a(href="/ui/plan/") { "Meal Plan" }}
span { a(href="/ui/") { "Meal Plan" }}
}
}
}

View File

@ -23,12 +23,10 @@ use sycamore_router::{HistoryIntegration, Route, Router, RouterProps};
#[derive(Route, Debug)]
enum AppRoutes {
#[to("/ui")]
Root,
#[to("/ui/")]
Plan,
#[to("/ui/recipe/<index>")]
Recipe { index: usize },
#[to("/ui/plan")]
Plan,
#[not_found]
NotFound,
}
@ -36,15 +34,12 @@ enum AppRoutes {
fn route_switch<G: Html>(route: ReadSignal<AppRoutes>) -> View<G> {
view! {
(match route.get().as_ref() {
AppRoutes::Root => view! {
Start()
AppRoutes::Plan => view! {
MealPlan()
},
AppRoutes::Recipe { index: idx } => view! {
RecipeView(*idx)
},
AppRoutes::Plan => view! {
MealPlan()
},
AppRoutes::NotFound => view! {
"NotFound"
},