feat(web): add group list page
This commit is contained in:
parent
9425b96bdd
commit
9548b4bb44
4 changed files with 19 additions and 1 deletions
web/src
|
@ -1,7 +1,7 @@
|
|||
use apb::Collection;
|
||||
use leptos::{either::Either, prelude::*};
|
||||
use leptos_router::{components::*, hooks::use_location, path};
|
||||
use crate::prelude::*;
|
||||
use crate::{groups::GroupList, prelude::*};
|
||||
|
||||
use leptos_use::{
|
||||
signal_debounced, storage::use_local_storage, use_cookie_with_options, use_element_size, use_window_scroll,
|
||||
|
@ -186,6 +186,7 @@ pub fn App() -> impl IntoView {
|
|||
<Route path=path!("local") view=move || view! { <Feed tl=feeds.server /> } />
|
||||
<Route path=path!("notifications") view=move || view! { <Feed tl=feeds.notifications ignore_filters=true /> } />
|
||||
<Route path=path!("tags/:id") view=move || view! { <HashtagFeed tl=feeds.tag /> } />
|
||||
<Route path=path!("groups") view=GroupList />
|
||||
|
||||
<Route path=path!("about") view=AboutPage />
|
||||
<Route path=path!("config") view=move || view! { <ConfigPage setter=set_config /> } />
|
||||
|
|
|
@ -45,6 +45,7 @@ pub fn Navigator(notifications: ReadSignal<u64>) -> impl IntoView {
|
|||
<td class="w-50"><a href="/web/about"><input class="w-100" type="submit" value="about" /></a></td>
|
||||
<td class="w-50"><a href="/web/config"><input class="w-100" type="submit" value="config" /></a></td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><a href="/web/groups"><input class="w-100" type="submit" value="groups" /></a></td></tr>
|
||||
<tr><td colspan="2"><a href="/web/explore"><input class="w-100" type="submit" class:hidden=move || !auth.present() value="explore" /></a></td></tr>
|
||||
</table>
|
||||
}
|
||||
|
|
15
web/src/groups.rs
Normal file
15
web/src/groups.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use leptos::prelude::*;
|
||||
use crate::{prelude::*, timeline::any::Loadable, FALLBACK_IMAGE_URL};
|
||||
|
||||
#[component]
|
||||
pub fn GroupList() -> impl IntoView {
|
||||
view! {
|
||||
<div>
|
||||
<Loadable
|
||||
base=format!("{URL_BASE}/groups/page")
|
||||
convert=U::Actor
|
||||
element=|obj| view! { <ActorBanner object=obj /><hr/> }
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ mod app;
|
|||
mod components;
|
||||
mod page;
|
||||
mod config;
|
||||
mod groups;
|
||||
|
||||
mod actors;
|
||||
mod activities;
|
||||
|
|
Loading…
Add table
Reference in a new issue