aboutsummaryrefslogtreecommitdiff
path: root/src/Post.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-25 15:33:33 -0300
committerLibravatar Renard 2019-09-25 15:33:33 -0300
commit2e496411a387493e87087d90deb4ed5efe3c3417 (patch)
tree28f4043d37275abc82a78b739e2ef35afdfffd87 /src/Post.js
parent30d3bf92fe11bcdfeeaf070732f28d9cd5be799a (diff)
downloadbai-client-2e496411a387493e87087d90deb4ed5efe3c3417.tar.gz
bai-client-2e496411a387493e87087d90deb4ed5efe3c3417.tar.xz
bai-client-2e496411a387493e87087d90deb4ed5efe3c3417.zip
Variable destructuring ✨
Diffstat (limited to 'src/Post.js')
-rw-r--r--src/Post.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Post.js b/src/Post.js
index 9a467cb..8193ec1 100644
--- a/src/Post.js
+++ b/src/Post.js
@@ -69,6 +69,9 @@ const QuickReplyModal = ({ trigger, currentBoard, id, locked, replyIndex }) => (
);
const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
+ const filesize = require("filesize");
+
+ // Manejo de posts eliminados
if (post.IS_DELETED > 0) {
return (
<Comment>
@@ -94,8 +97,8 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
);
}
+ // Obtener un avatar aleatorio basado en ID
let user_id = post.timestamp_formatted.split(" ID:")[1];
- const filesize = require("filesize");
const seedrandom = require("seedrandom");
const rng = seedrandom(threadId + index);
const idRng = seedrandom(user_id);
@@ -119,8 +122,8 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
hue = Math.round(rng() * 360);
}
+ // Obetener bandera del pais (para /world)
let flag;
-
if (currentBoard.dir === "world") {
flag = post.name.match("[A-Z][A-Z]");
if (flag !== null) {
@@ -130,11 +133,13 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
}
}
+ // Fix: imagenes en dominio incorrecto
post.message = post.message.replace(
'<img src="/',
'<img src="https://bienvenidoainternet.org/'
);
+ // Fix para reach-router
if (currentBoard.board_type === 0) {
post.message = post.message.replace("/res/", "/read/");
post.message = post.message.replace(".html#", "/");
@@ -143,7 +148,8 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
if (post.tripcode === " (★ ****-****)") {
post.tripcode = "";
}
- //(?:https?:\/\/)?(?:www\.)?youtu(.be\/|be\.com\/watch\?v=)(\w{11})
+
+ // Obtener lista de videos de youtube incrustados
const youtubeRe = RegExp(
/(?:https?:\/\/)?(?:www\.)?youtu(.be\/|be\.com\/watch\?v=)(\w{11})/g
);