From 27a8a4e5202c71b3bcd84fd2eb16021fc474859c Mon Sep 17 00:00:00 2001 From: plebbitor Date: Sun, 23 Apr 2023 13:37:09 +0200 Subject: [PATCH] added media to thread mobile replies --- src/components/views/Thread.jsx | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index 3087cfcd..7e767efd 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -746,6 +746,7 @@ const Thread = () => { {comment.replyCount === undefined ? : null} {renderedComments.map((reply, index) => { + const replyMediaInfo = getCommentMediaInfo(reply); const shortParentCid = findShortParentCid(reply.parentCid, comment); return (
@@ -804,6 +805,39 @@ const Thread = () => { )}
+ {reply.link ? ( +
+ + {replyMediaInfo?.url ? ( + replyMediaInfo.type === "webpage" ? ( + + thumbnail e.target.src = fallbackImgUrl} /> +
{replyMediaInfo.type}
+
+ ) : replyMediaInfo.type === "image" ? ( + + {replyMediaInfo.type} e.target.src = fallbackImgUrl} /> +
{replyMediaInfo.type}
+
+ ) : replyMediaInfo.type === "video" ? ( + + + ) : replyMediaInfo.type === "audio" ? ( + + + ) : null + ) : null} +
+
+ ) : null}
{}} key={`mob-ql-${index}`} className="quotelink-mobile" onClick={(event) => handleQuoteClick(reply, shortParentCid, comment.shortCid, event)}>