working proto

This commit is contained in:
Romulus21
2024-09-28 00:52:51 +02:00
parent 9bc48ff63d
commit 72b65063be
20 changed files with 1706 additions and 1569 deletions

View File

@@ -1,34 +1,34 @@
use crate::values::FormValues;
use crate::todo::TodoApp;
use leptos::prelude::*;
use leptos::*;
use leptos_meta::*;
use leptos_router::{
components::{FlatRoutes, Route, Router},
ParamSegment, SsrMode, StaticSegment,
};
use leptos_router::*;
use crate::routes::*;
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
let fallback = || view! { "Page not found." }.into_view();
view! {
<Router>
<nav class="flex gap-5 px-2 py-1 ">
<a href="/">Home</a>
<a href="/formulaire">Formulaire</a>
<a href="/todos">Todos</a>
</nav>
<main>
<FlatRoutes fallback>
<Route path=StaticSegment("/") view=Home ssr=SsrMode::Async/>
<Route path=StaticSegment("/formulaire") view=FormValues ssr=SsrMode::Async />
<Route path=StaticSegment("/todos") view=TodoApp ssr=SsrMode::Async />
<Route path=StaticSegment("/*any") view=NotFound ssr=SsrMode::Async/>
</FlatRoutes>
</main>
</Router>
<Stylesheet href="/pkg/rust_leptos.css"/>
<Title text="Welcome to Leptos"/>
<div class="dark:bg-slate-950 dark:text-white h-screen flex flex-col">
<Router>
<nav class="flex gap-5 px-2 py-1 ">
<a href="/">Home</a>
<a href="/formulaire">Formulaire</a>
</nav>
<main class="flex-1">
<Routes>
<Route path="/" view=move || view! { <Home/> }/>
<Route path="/formulaire" view=move || view! { <FormValues/> }/>
//<Route path="/*any" view=move || view! { <NotFound/> }/>
</Routes>
</main>
<footer>Footer</footer>
</Router>
</div>
}
}