Compare commits

..

No commits in common. "0efe1a33017a8a5a2c267c3d5f3ce280fa2fd5eb" and "a0394ca94e34b827e5495960d70f7a9e4a2273e9" have entirely different histories.

View file

@ -1,6 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use apb::Collection; use apb::{Base, Collection};
use leptos::*; use leptos::*;
use leptos_router::*; use leptos_router::*;
use crate::prelude::*; use crate::prelude::*;
@ -9,9 +9,7 @@ use crate::prelude::*;
pub fn SearchPage() -> impl IntoView { pub fn SearchPage() -> impl IntoView {
let auth = use_context::<Auth>().expect("missing auth context"); let auth = use_context::<Auth>().expect("missing auth context");
let query = Signal::derive(|| let query = use_query_map().get().get("q").cloned().unwrap_or_default();
use_query_map().with(|x| x.get("q").cloned().unwrap_or_default())
);
let user = create_local_resource( let user = create_local_resource(
move || use_query_map().get().get("q").cloned().unwrap_or_default(), move || use_query_map().get().get("q").cloned().unwrap_or_default(),
@ -80,7 +78,7 @@ pub fn SearchPage() -> impl IntoView {
</summary> </summary>
<div class="pb-1"> <div class="pb-1">
<ul> <ul>
<li><a href={format!("/web/tags/{}", query.get())}>#{query}</a></li> <li><a href={format!("/web/tags/{query}")}>#{query}</a></li>
</ul> </ul>
</div> </div>
</details> </details>
@ -103,7 +101,11 @@ pub fn SearchPage() -> impl IntoView {
key=|id| id.clone() key=|id| id.clone()
children=move |item| { children=move |item| {
cache::OBJECTS.get(&item) cache::OBJECTS.get(&item)
.map(|x| view! { <Item item=x always=true /> }.into_view()) .map(|x| view! {
<Item item=x />
<hr />
}.into_view()
)
} }
/ > / >
}.into_view()) }.into_view())