diff options
author | Ashelyn Rose <git@ashen.earth> | 2025-03-22 14:51:36 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2025-03-22 14:51:36 -0600 |
commit | 63e2395caf4ae93ebde96d97e12fc946af1e9ac9 (patch) | |
tree | 2f5dbca4da84a99398b6677726621881bb04c037 /src/components/app.rs | |
parent | b18f08e8899b5a98dd3e1f8439ad812951a04cd9 (diff) |
Component styles and hot-reloading
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); |