fix(web): no controls in quoted post
This commit is contained in:
parent
d28019fb18
commit
ea4bd1e4c2
1 changed files with 11 additions and 7 deletions
|
@ -6,7 +6,7 @@ use crate::{prelude::*, URL_SENSITIVE};
|
||||||
use apb::{ActivityMut, Base, Collection, CollectionMut, Object, ObjectMut, Shortcuts};
|
use apb::{ActivityMut, Base, Collection, CollectionMut, Object, ObjectMut, Shortcuts};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Object(object: crate::Object) -> impl IntoView {
|
pub fn Object(object: crate::Object, #[prop(default = true)] controls: bool) -> impl IntoView {
|
||||||
let oid = object.id().unwrap_or_default().to_string();
|
let oid = object.id().unwrap_or_default().to_string();
|
||||||
let author_id = object.attributed_to().id().ok().unwrap_or_default();
|
let author_id = object.attributed_to().id().ok().unwrap_or_default();
|
||||||
let author = cache::OBJECTS.get_or(&author_id, serde_json::Value::String(author_id.clone()).into());
|
let author = cache::OBJECTS.get_or(&author_id, serde_json::Value::String(author_id.clone()).into());
|
||||||
|
@ -56,7 +56,7 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
||||||
.and_then(|x| {
|
.and_then(|x| {
|
||||||
Some(view! {
|
Some(view! {
|
||||||
<div class="quote">
|
<div class="quote">
|
||||||
<Object object=crate::cache::OBJECTS.get(&x)? />
|
<Object object=crate::cache::OBJECTS.get(&x)? controls=false />
|
||||||
</div>
|
</div>
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -211,11 +211,15 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
||||||
{quote_badge}
|
{quote_badge}
|
||||||
{tag_badges}
|
{tag_badges}
|
||||||
{audience_badge}
|
{audience_badge}
|
||||||
<span style="white-space:nowrap">
|
{if controls {
|
||||||
<ReplyButton n=comments target=oid.clone() />
|
Some(view! {
|
||||||
<LikeButton n=likes liked=already_liked target=oid.clone() author=author_id.clone() private=!privacy.is_public() />
|
<span style="white-space:nowrap">
|
||||||
{if privacy.is_public() { Some(view! { <RepostButton n=shares target=oid author=author_id /> }) } else { None }}
|
<ReplyButton n=comments target=oid.clone() />
|
||||||
</span>
|
<LikeButton n=likes liked=already_liked target=oid.clone() author=author_id.clone() private=!privacy.is_public() />
|
||||||
|
{if privacy.is_public() { Some(view! { <RepostButton n=shares target=oid author=author_id /> }) } else { None }}
|
||||||
|
</span>
|
||||||
|
})
|
||||||
|
} else { None }}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue