mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Remove root page from the routes
This commit is contained in:
parent
4eaf2ff36b
commit
b4f04a2b04
@ -18,9 +18,7 @@ use sycamore::prelude::*;
|
|||||||
pub fn header() -> View<G> {
|
pub fn header() -> View<G> {
|
||||||
view! {
|
view! {
|
||||||
div(class="menu") {
|
div(class="menu") {
|
||||||
span { a(href="/ui/") { "Home" }}
|
span { a(href="/ui/") { "Meal Plan" }}
|
||||||
" | "
|
|
||||||
span { a(href="/ui/plan/") { "Meal Plan" }}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,10 @@ use sycamore_router::{HistoryIntegration, Route, Router, RouterProps};
|
|||||||
|
|
||||||
#[derive(Route, Debug)]
|
#[derive(Route, Debug)]
|
||||||
enum AppRoutes {
|
enum AppRoutes {
|
||||||
#[to("/ui")]
|
#[to("/ui/")]
|
||||||
Root,
|
Plan,
|
||||||
#[to("/ui/recipe/<index>")]
|
#[to("/ui/recipe/<index>")]
|
||||||
Recipe { index: usize },
|
Recipe { index: usize },
|
||||||
#[to("/ui/plan")]
|
|
||||||
Plan,
|
|
||||||
#[not_found]
|
#[not_found]
|
||||||
NotFound,
|
NotFound,
|
||||||
}
|
}
|
||||||
@ -36,15 +34,12 @@ enum AppRoutes {
|
|||||||
fn route_switch<G: Html>(route: ReadSignal<AppRoutes>) -> View<G> {
|
fn route_switch<G: Html>(route: ReadSignal<AppRoutes>) -> View<G> {
|
||||||
view! {
|
view! {
|
||||||
(match route.get().as_ref() {
|
(match route.get().as_ref() {
|
||||||
AppRoutes::Root => view! {
|
AppRoutes::Plan => view! {
|
||||||
Start()
|
MealPlan()
|
||||||
},
|
},
|
||||||
AppRoutes::Recipe { index: idx } => view! {
|
AppRoutes::Recipe { index: idx } => view! {
|
||||||
RecipeView(*idx)
|
RecipeView(*idx)
|
||||||
},
|
},
|
||||||
AppRoutes::Plan => view! {
|
|
||||||
MealPlan()
|
|
||||||
},
|
|
||||||
AppRoutes::NotFound => view! {
|
AppRoutes::NotFound => view! {
|
||||||
"NotFound"
|
"NotFound"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user