diff --git a/web/src/components/object.rs b/web/src/components/object.rs index b1a7c21..ad6c9c4 100644 --- a/web/src/components/object.rs +++ b/web/src/components/object.rs @@ -1,5 +1,5 @@ use leptos::*; -use crate::prelude::*; +use crate::{prelude::*, URL_SENSITIVE}; use apb::{target::Addressed, Base, Object}; @@ -10,15 +10,21 @@ pub fn Object(object: serde_json::Value) -> impl IntoView { let content = dissolve::strip_html_tags(object.content().unwrap_or_default()); let author_id = object.attributed_to().id().unwrap_or_default(); let author = CACHE.get_or(&author_id, serde_json::Value::String(author_id.clone())); + let sensitive = object.sensitive().unwrap_or_default(); let attachments = object.attachment() .map(|x| { let (expand, set_expand) = create_signal(false); + let href = x.url().id().unwrap_or_default(); view! {

@@ -48,7 +54,7 @@ pub fn Object(object: serde_json::Value) -> impl IntoView {

- + {content.into_iter().map(|x| view! {

{x}

}).collect_view()} {attachments_padding} {attachments} @@ -58,11 +64,11 @@ pub fn Object(object: serde_json::Value) -> impl IntoView { } #[component] -pub fn Summary(summary: Option, children: Children) -> impl IntoView { +pub fn Summary(summary: Option, open: bool, children: Children) -> impl IntoView { match summary.filter(|x| !x.is_empty()) { None => children().into_view(), Some(summary) => view! { -
+
{summary} diff --git a/web/src/control.rs b/web/src/control.rs index 128265a..9602e2e 100644 --- a/web/src/control.rs +++ b/web/src/control.rs @@ -95,6 +95,7 @@ pub fn AdvancedPostBox(username: Signal>, advanced: WriteSignal = create_node_ref(); let summary_ref: NodeRef = create_node_ref(); let content_ref: NodeRef = create_node_ref(); let context_ref: NodeRef = create_node_ref(); @@ -139,12 +140,20 @@ pub fn AdvancedPostBox(username: Signal>, advanced: WriteSignal
- - + + + + + +
+ + +
+
diff --git a/web/src/lib.rs b/web/src/lib.rs index 4bb03e6..f2161dd 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -10,6 +10,7 @@ pub mod prelude; pub const URL_BASE: &str = "https://feditest.alemi.dev"; pub const URL_PREFIX: &str = "/web"; +pub const URL_SENSITIVE: &str = "https://cdn.alemi.dev/social/nsfw.png"; pub const NAME: &str = "μ"; use std::sync::Arc;