diff --git a/web/src/actors/follow.rs b/web/src/actors/follow.rs index 50432e1..6be754f 100644 --- a/web/src/actors/follow.rs +++ b/web/src/actors/follow.rs @@ -27,11 +27,13 @@ pub fn FollowList(outgoing: bool) -> impl IntoView { } ); view! { - {symbol}" "{follow___}
{move || match resource.get() { None => view! { }.into_view(), - Some(Err(e)) => view! {

could not load {follow___}: {e}

}.into_view(), + Some(Err(e)) => { + tracing::error!("could not load followers: {e}"); + view! { {follow___}" unavailable" }.into_view() + }, Some(Ok(mut arr)) => { // TODO cheap fix: server gives us follows from oldest to newest // but it's way more convenient to have them other way around diff --git a/web/src/actors/header.rs b/web/src/actors/header.rs index e6d7b7c..c2b2bbb 100644 --- a/web/src/actors/header.rs +++ b/web/src/actors/header.rs @@ -1,6 +1,6 @@ use leptos::*; use leptos_router::*; -use crate::{getters::Getter, prelude::*, FALLBACK_IMAGE_URL}; +use crate::{app::FeedRoute, getters::Getter, prelude::*, FALLBACK_IMAGE_URL}; use apb::{ActivityMut, Actor, Base, Object, ObjectMut, Shortcuts}; @@ -8,6 +8,7 @@ use apb::{ActivityMut, Actor, Base, Object, ObjectMut, Shortcuts}; pub fn ActorHeader() -> impl IntoView { let params = use_params::(); let auth = use_context::().expect("missing auth context"); + let matched_route = use_context::>().expect("missing route context"); let actor = create_local_resource( move || params.get().ok().and_then(|x| x.id).unwrap_or_default(), move |id| { @@ -99,6 +100,18 @@ pub fn ActorHeader() -> impl IntoView { {fields}

+

+ + "🖂 ""statuses" + + + "📢 ""followers" + + + "👥 ""following" + +

+
}.into_view() }, diff --git a/web/src/actors/posts.rs b/web/src/actors/posts.rs index 674bc0b..b60369e 100644 --- a/web/src/actors/posts.rs +++ b/web/src/actors/posts.rs @@ -14,9 +14,6 @@ pub fn ActorPosts() -> impl IntoView { } }); view! { - - "🖂"" "posts - } } diff --git a/web/src/app.rs b/web/src/app.rs index abbe7a0..28e4841 100644 --- a/web/src/app.rs +++ b/web/src/app.rs @@ -210,7 +210,7 @@ pub fn App() -> impl IntoView { #[derive(Debug, Clone, Copy)] pub(crate) enum FeedRoute { - Home, Global, Server, Notifications, User, Replies, Context + Home, Global, Server, Notifications, User, Following, Followers, Likes, Replies, Context } #[component] @@ -238,8 +238,24 @@ fn Scrollable() -> impl IntoView { set_route.set(FeedRoute::Notifications); Some(feeds.notifications) } else if path.starts_with("/web/actors") { - set_route.set(FeedRoute::User); - Some(feeds.user) + match path.split('/').nth(4) { + Some("following") => { + set_route.set(FeedRoute::Following); + None + }, + Some("followers") => { + set_route.set(FeedRoute::Followers); + None + }, + Some("likes") => { + set_route.set(FeedRoute::Likes); + None + }, + _ => { + set_route.set(FeedRoute::User); + Some(feeds.user) + }, + } } else if path.starts_with("/web/objects") { if matches!(path.split('/').nth(4), Some("replies")) { set_route.set(FeedRoute::Replies);