forked from alemi/upub
feat(web): show articles without borders
This commit is contained in:
parent
cb9cae1af8
commit
b904883e15
1 changed files with 16 additions and 5 deletions
|
@ -125,21 +125,32 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
||||||
</Summary>
|
</Summary>
|
||||||
};
|
};
|
||||||
let post = match object.object_type() {
|
let post = match object.object_type() {
|
||||||
Some(apb::ObjectType::Document(apb::DocumentType::Page)) => view! {
|
// mastodon, pleroma, misskey
|
||||||
|
Some(apb::ObjectType::Note) => view! {
|
||||||
|
<blockquote class="tl">{post_inner}</blockquote>
|
||||||
|
}.into_view(),
|
||||||
|
// lemmy with Page, peertube with Video
|
||||||
|
Some(apb::ObjectType::Document(_)) => view! {
|
||||||
<div class="border ml-1 mr-1 mt-1">
|
<div class="border ml-1 mr-1 mt-1">
|
||||||
<b>{object.name().unwrap_or_default().to_string()}</b>
|
<b>{object.name().unwrap_or_default().to_string()}</b>
|
||||||
<hr />
|
<hr />
|
||||||
{post_inner}
|
{post_inner}
|
||||||
</div>
|
</div>
|
||||||
}.into_view(), // lemmy
|
|
||||||
Some(apb::ObjectType::Document(apb::DocumentType::Video)) => post_inner.into_view(), // peertube?
|
|
||||||
Some(apb::ObjectType::Note) => view! {
|
|
||||||
<blockquote class="tl">{post_inner}</blockquote>
|
|
||||||
}.into_view(),
|
}.into_view(),
|
||||||
|
// wordpress, ... ?
|
||||||
|
Some(apb::ObjectType::Article) => view! {
|
||||||
|
<div>
|
||||||
|
<h3>{object.name().unwrap_or_default().to_string()}</h3>
|
||||||
|
<hr />
|
||||||
|
{post_inner}
|
||||||
|
</div>
|
||||||
|
}.into_view(),
|
||||||
|
// everything else
|
||||||
Some(t) => view! {
|
Some(t) => view! {
|
||||||
<h3>{t.as_ref().to_string()}</h3>
|
<h3>{t.as_ref().to_string()}</h3>
|
||||||
{post_inner}
|
{post_inner}
|
||||||
}.into_view(),
|
}.into_view(),
|
||||||
|
// object without type?
|
||||||
None => view! { <code>missing object type</code> }.into_view(),
|
None => view! { <code>missing object type</code> }.into_view(),
|
||||||
};
|
};
|
||||||
view! {
|
view! {
|
||||||
|
|
Loading…
Reference in a new issue