diff options
author | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-22 17:43:59 -0600 |
---|---|---|
committer | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-22 17:43:59 -0600 |
commit | 2d73518bc8b89b1e5f2cd638a9a3e2fd13785f92 (patch) | |
tree | 6f6cd8517edfe71a38ce425dd908611c297eab58 /src/components/mod.rs | |
parent | 95a92e842e448446f353be1ae375e79d50ac9d59 (diff) |
Support comment image attachments
Diffstat (limited to 'src/components/mod.rs')
-rw-r--r-- | src/components/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/mod.rs b/src/components/mod.rs index 9f7db1f..f045023 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -53,6 +53,19 @@ pub fn Comment<'a>( <TimeAgo since={chrono::DateTime::parse_from_rfc3339(&comment.created).unwrap()} lang /> </small> <Content src={comment} /> + { + comment.attachments.iter().map(|attachment| { + let href = &attachment.url; + render::rsx! { + <div> + <strong>{lang.tr("comment_attachment_prefix", None)}</strong> + {" "} + <em><a href={href.as_ref()}>{abbreviate_link(&href)}{" ↗"}</a></em> + </div> + } + }) + .collect::<Vec<_>>() + } <div class={"actionList"}> { if base_data.login.is_some() { |