From dbb9a17b7520431e291a2a43683d3ce4a9ed4687 Mon Sep 17 00:00:00 2001 From: Renard Date: Thu, 26 Sep 2019 13:01:21 -0300 Subject: AƱadido: Embed de videos, audio y otros archivos --- src/App.css | 5 ++++ src/Post.js | 84 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/src/App.css b/src/App.css index 7f8d2e3..4698349 100644 --- a/src/App.css +++ b/src/App.css @@ -122,4 +122,9 @@ .ui.modal>.content.replyModal { padding: 0 !important; +} + +.postMessage hr, +.postMessage small { + display: none } \ No newline at end of file diff --git a/src/Post.js b/src/Post.js index 54e56e7..38eac8e 100644 --- a/src/Post.js +++ b/src/Post.js @@ -176,9 +176,23 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => { } else if (isMine) { starColor = "blue"; } else { - starColor = "gray"; + starColor = "grey"; } + let hasVideo = post.file.endsWith(".webm"); + let hasAudio = + post.file.endsWith(".mp3") || + post.file.endsWith(".opus") || + post.file.endsWith(".ogg"); + let isMime = + post.file.endsWith(".epub") || + post.file.endsWith(".mod") || + post.file.endsWith(".pdf") || + post.file.endsWith(".s3m") || + post.file.endsWith(".swf") || + post.file.endsWith(".torrent") || + post.file.endsWith(".xm"); + return ( { {post.file !== "" ? (
- - } - /> - - {post.file} - {" "} - {post.image_width}x{post.image_height}{" "} - {filesize(post.file_size, { bits: true })} + {hasVideo && ( + // eslint-disable-next-line jsx-a11y/media-has-caption +
) : null} -- cgit v1.2.1-18-gbd029