use std::sync::Arc; use apb::{ActivityMut, Actor, Base, Object, ObjectMut}; use leptos::*; use leptos_router::*; use crate::{prelude::*, DEFAULT_AVATAR_URL}; #[component] pub fn AboutPage() -> impl IntoView { view! {
μpub
" is a micro social network powered by "ActivityPub
"the "fediverse" is an ensemble of social networks, which, while independently hosted, can communicate with each other"
content is aggregated in timelines, logged out users can only access global server timeline
"not implemented :("
loading...
}.into_view(), Some(None) => { view! {loading failed
"↗"
{display_name}{actor_type_tag} | {statuses}" ""\u{1f582}" | |
{username.clone()}@{domain} | {following}" ""👥" | |
|
{followers}" ""📢" |
following
}.into_view()
} else {
view! { }.into_view()
}}
{if following_me {
Some(view! { follows you
})
} else {
None
}}
loading ...
}.into_view(), Some(None) => { let uid = uid.clone(); view! {loading failed
"↗"
{move || serde_json::to_string_pretty(object.get().as_ref()).unwrap_or("unserializable".to_string())}
{move || match user.get() { None => None, Some(None) => None, Some(Some(u)) => Some(view! {
users
}), }}
} } // this is a rather weird way to fetch but i want to see the bare error text if it fails! async fn debug_fetch(url: &str, token: Auth) -> serde_json::Value { match Http::request::<()>(reqwest::Method::GET, url, None, token).await { Err(e) => serde_json::Value::String(format!("[!] failed sending request: {e}")), Ok(res) => match res.text().await { Err(e) => serde_json::Value::String(format!("[!] invalid response body: {e}")), Ok(x) => match serde_json::from_str(&x) { Err(_) => serde_json::Value::String(x), Ok(v) => v, }, } } }{move || match object.get() { None => None, Some(None) => None, Some(Some(o)) => Some(view! { }), }}
objects