diff options
Diffstat (limited to 'src/components/app.rs')
-rw-r--r-- | src/components/app.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/components/app.rs b/src/components/app.rs index 0a5ed80..7e2676a 100644 --- a/src/components/app.rs +++ b/src/components/app.rs @@ -1,10 +1,11 @@ use leptos::prelude::*; use leptos_meta::{provide_meta_context, MetaTags, Stylesheet, Title}; use leptos_router::{ - components::{Route, Router, Routes}, - StaticSegment, + components::{ParentRoute, Route, Router, Routes}, path, StaticSegment }; +use crate::components::layout::Layout; + pub fn shell(options: LeptosOptions) -> impl IntoView { view! { <!DOCTYPE html> @@ -38,17 +39,17 @@ pub fn App() -> impl IntoView { // content for this welcome page <Router> - <main> - <Routes fallback=|| "Page not found.".into_view()> - <Route path=StaticSegment("") view=HomePage/> - </Routes> - </main> + <Routes fallback=|| "Page not found.".into_view()> + <ParentRoute path=path!("/") view=Layout> + <Route path=path!("/") view=HomePage/> + </ParentRoute> + </Routes> </Router> } } /// Renders the home page of your application. -#[island] +#[component] fn HomePage() -> impl IntoView { // Creates a reactive value to update the button let count = RwSignal::new(0); |