From 1b34241d8fd9a0e5cbaa7e84e44853e1dc4dd484 Mon Sep 17 00:00:00 2001 From: plebbitor Date: Thu, 23 Mar 2023 16:23:59 +0100 Subject: [PATCH] added media to mobile views --- src/components/views/Board.jsx | 37 +++++++++++++++++++++++++++------ src/components/views/Thread.jsx | 37 +++++++++++++++++++++++++++------ 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index ceb8ccd8..f99abab2 100644 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -693,12 +693,37 @@ const Board = () => { -
- - -
58 KB JPG
- -
+ {commentMediaInfo?.url ? ( + commentMediaInfo.type === "webpage" ? ( +
+ + thumbnail e.target.src = fallbackImgUrl} /> +
{commentMediaInfo.type}
+
+
+ ) : commentMediaInfo.type === "image" ? ( +
+ + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> +
{commentMediaInfo.type}
+
+
+ ) : commentMediaInfo.type === "video" ? ( +
+ + +
+ ) : commentMediaInfo.type === "audio" ? ( +
+ + +
+ ) : null + ) : null} {thread.content ? ( thread.content.length > 1500 ? diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index 3265604e..14395085 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -651,12 +651,37 @@ const Thread = () => { {comment.cid?.slice(0, 8)} -
- - -
58 KB JPG
- -
+ {commentMediaInfo?.url ? ( + commentMediaInfo.type === "webpage" ? ( +
+ + thumbnail e.target.src = fallbackImgUrl} /> +
{commentMediaInfo.type}
+
+
+ ) : commentMediaInfo.type === "image" ? ( +
+ + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> +
{commentMediaInfo.type}
+
+
+ ) : commentMediaInfo.type === "video" ? ( +
+ + +
+ ) : commentMediaInfo.type === "audio" ? ( +
+ + +
+ ) : null + ) : null}
{comment.content ? ( <>