Add tag filter
This commit is contained in:
parent
de6892627f
commit
bd9f35c993
1 changed files with 9 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue