Add tag filter

This commit is contained in:
Florian RICHER 2024-01-12 22:11:09 +01:00
parent de6892627f
commit bd9f35c993

View file

@ -129,9 +129,18 @@ pub fn PostList() -> impl IntoView {
})
};
let filter_view = move || {
tag().and_then(|tag| Some(view! {
<div class="mx-auto max-w-3xl mb-5">
Tag sélectionné : <A class="tag" href="/posts".to_string()>{tag}<leptos_icons::Icon icon=icondata::IoCloseOutline class="scale-125 ml-1 inline" /></A>
</div>
}))
};
view! {
<Suspense fallback=move || view! { <Loading title="Chargement des posts...".to_string() /> }>
<Nav/>
{filter_view}
<main class="posts">
<div class="posts__cards">{posts_view}</div>
</main>