fix(web): nicer lemmy posts

This commit is contained in:
əlemi 2024-07-03 04:59:28 +02:00
parent b6f4539424
commit 6907560aaa
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -78,11 +78,13 @@ pub fn Attachment(
"link" => "link" =>
view! { view! {
<code class="cw color center mt-1 mb-1 mr-s ml-s"> <ul> // TODO kind of wasteful to make 1-item list, can we just add the same style to a div?
<a href={href.clone()} title={href.clone()} rel="noreferrer nofollow" target="_blank"> <li>
{Uri::pretty(&href)} <a href={href.clone()} title={href.clone()} rel="noreferrer nofollow" target="_blank">
</a> {Uri::pretty(&href)}
</code> </a>
</li>
</ul>
{object.name().map(|name| { {object.name().map(|name| {
view! { view! {
<p class="center mt-0"><small>{name.to_string()}</small></p> <p class="center mt-0"><small>{name.to_string()}</small></p>
@ -161,10 +163,10 @@ pub fn Object(object: crate::Object) -> impl IntoView {
}.into_view(), }.into_view(),
// lemmy with Page, peertube with Video // lemmy with Page, peertube with Video
Ok(apb::ObjectType::Document(t)) => view! { Ok(apb::ObjectType::Document(t)) => view! {
<article> <article class="ml-1 mr-1">
<div class="border center pr-1 pl-1 pt-s pb-s ma-1" title={t.as_ref().to_string()}> <h4 class="mt-s mb-1" title={t.as_ref().to_string()}>
<b>{object.name().unwrap_or_default().to_string()}</b> <b>{object.name().unwrap_or_default().to_string()}</b>
</div> </h4>
{post_inner} {post_inner}
</article> </article>
}.into_view(), }.into_view(),