diff --git a/web/index.html b/web/index.html index 35e5a96..596e438 100644 --- a/web/index.html +++ b/web/index.html @@ -203,6 +203,16 @@ min-width: 2em; max-width: 2em; } + div.flex-pic-container { + flex: 1; + border: solid 3px #bf616a; + margin-right: .5em; + } + div.flex-pic { + background-size: cover; + margin: 5px; + height: calc(100% - 10px); /* TODO can we avoid this calc() without having this overflow??? */ + } .box { border: 3px solid var(--accent); } @@ -215,7 +225,6 @@ img.attachment { cursor: pointer; height: 10em; - width: 100%; border: 3px solid var(--accent); padding: 5px; object-fit: cover; diff --git a/web/src/components/object.rs b/web/src/components/object.rs index d65fa97..3df22c4 100644 --- a/web/src/components/object.rs +++ b/web/src/components/object.rs @@ -38,7 +38,7 @@ pub fn Attachment( view! {

view! { -

- {object.name().map(|name| { - view! { -

{name.to_string()}

- } - })} +

+ + + +

}.into_view(), _ => @@ -149,6 +142,15 @@ pub fn Object(object: crate::Object) -> impl IntoView { }); + let post_image = object.image().get().and_then(|x| x.url().id().str()).map(|x| view! { +
+ +
+
+
+
+ }); + let post_inner = view! {

@@ -163,11 +165,14 @@ pub fn Object(object: crate::Object) -> impl IntoView { }.into_view(), // lemmy with Page, peertube with Video Ok(apb::ObjectType::Document(t)) => view! { -
-

- {object.name().unwrap_or_default().to_string()} -

- {post_inner} +
+ {post_image} +
+

+ {object.name().unwrap_or_default().to_string()} +

+ {post_inner} +
}.into_view(), // wordpress, ... ?