From 1734b6078ba392012683d0642bf43639d9369919 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 18 Apr 2024 04:26:57 +0200 Subject: [PATCH] feat(web): crude way to show in_reply_to --- web/src/view.rs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/web/src/view.rs b/web/src/view.rs index 2e5d590..26274ad 100644 --- a/web/src/view.rs +++ b/web/src/view.rs @@ -92,6 +92,8 @@ pub fn ActorBanner( #[component] pub fn Object(object: serde_json::Value) -> impl IntoView { + let oid = object.id().unwrap_or_default().to_string(); + let in_reply_to = object.in_reply_to().id().unwrap_or_default(); let summary = object.summary().unwrap_or_default().to_string(); let content = dissolve::strip_html_tags(object.content().unwrap_or_default()); let date = object.published(); @@ -100,15 +102,22 @@ pub fn Object(object: serde_json::Value) -> impl IntoView { view! {
+ {move || if !in_reply_to.is_empty() { + Some(view! { + + + + }) + } else { None }} {move || if !summary.is_empty() { - view! { + Some(view! { - }.into_view() - } else { - view! { }.into_view() - }} + }) + } else { None }} - +
+ "in reply to "{Uri::pretty(&in_reply_to)} +
{summary.clone()}
{ content.into_iter().map(|x| view! {

{x}

}).collect_view() @@ -116,7 +125,11 @@ pub fn Object(object: serde_json::Value) -> impl IntoView {
+ + + +