Compare commits

...

2 commits

Author SHA1 Message Date
6841691910
fix(web): limit all images max width 2024-05-13 17:18:31 +02:00
b904883e15
feat(web): show articles without borders 2024-05-13 17:18:16 +02:00
2 changed files with 19 additions and 5 deletions

View file

@ -156,6 +156,9 @@
position: relative; position: relative;
bottom: 3em; bottom: 3em;
} }
img {
max-width: 100%;
}
img.avatar-circle { img.avatar-circle {
display: inline; display: inline;
border-radius: 50%; border-radius: 50%;

View file

@ -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! {