aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-15 20:49:47 -0300
committerLibravatar Renard 2019-09-15 20:49:47 -0300
commit0729ffd3009025b690a275fe68ea5eac333425e9 (patch)
treeabc7f1681e579707ee359670130e695ffc17dbad
parent7d56318f997e37da8df5790a96594d15afdabec9 (diff)
downloadbai-client-0729ffd3009025b690a275fe68ea5eac333425e9.tar.gz
bai-client-0729ffd3009025b690a275fe68ea5eac333425e9.tar.xz
bai-client-0729ffd3009025b690a275fe68ea5eac333425e9.zip
Nuevo formato de post
-rw-r--r--package-lock.json5
-rw-r--r--package.json1
-rw-r--r--src/App.css5
-rw-r--r--src/BBSThread.js20
-rw-r--r--src/Post.js36
5 files changed, 53 insertions, 14 deletions
diff --git a/package-lock.json b/package-lock.json
index 2a45bc3..aa80848 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15258,6 +15258,11 @@
"compute-scroll-into-view": "1.0.11"
}
},
+ "seedrandom": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.3.tgz",
+ "integrity": "sha512-PJLhhxIMjlMJaiIRtqiVW061EZn3cS+waZkbFe7eCa2R3g88HbNdWmw4NTFG1w5unxd0GeNaUUxZJP7gPAzSDQ=="
+ },
"select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
diff --git a/package.json b/package.json
index 63d85c7..4e19b00 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"react-scripts": "3.1.1",
"react-time-ago": "^5.0.4",
"react-timestamp": "^5.1.0",
+ "seedrandom": "^3.0.3",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.1"
},
diff --git a/src/App.css b/src/App.css
index ab194ce..bdeb084 100644
--- a/src/App.css
+++ b/src/App.css
@@ -38,4 +38,9 @@
/* a quien estás citando? */
.q {
color: #080;
+}
+
+.postImage {
+ padding-top: 0.5em;
+ padding-bottom: 1em;
} \ No newline at end of file
diff --git a/src/BBSThread.js b/src/BBSThread.js
index dd220ce..b81264e 100644
--- a/src/BBSThread.js
+++ b/src/BBSThread.js
@@ -1,5 +1,5 @@
import React, { Component } from "react";
-import { Header, Icon, Loader, Message, Segment } from "semantic-ui-react";
+import { Header, Icon, Loader, Message, Segment, Comment } from "semantic-ui-react";
import Moment from "react-moment";
import "moment/locale/es";
import Post from "./Post";
@@ -74,14 +74,16 @@ class BBSThread extends Component {
</Header.Subheader>
</Header>
- {posts.map((post, index) =>
- post.IS_DELETED === 0 ?
- (<Post key={index} index={index} post={post} locked={locked} dir={this.props.dir} />) :
- (<Segment secondary>
- #{index} Eliminado <Moment fromNow unix locale="es" date={post.timestamp} />
- </Segment>)
- )
- }
+ <Comment.Group>
+ {posts.map((post, index) =>
+ post.IS_DELETED === 0 ?
+ (<Post key={index} index={index} post={post} locked={locked} dir={this.props.dir} threadId={id} />) :
+ (<Segment secondary>
+ #{index} Eliminado <Moment fromNow unix locale="es" date={post.timestamp} />
+ </Segment>)
+ )
+ }
+ </Comment.Group>
<ReplyForm dir={this.props.dir} parent={id} />
diff --git a/src/Post.js b/src/Post.js
index 8260d1f..5c197d2 100644
--- a/src/Post.js
+++ b/src/Post.js
@@ -1,21 +1,47 @@
import React from "react";
-import { Segment, Header, Image, Label, Icon, Modal } from "semantic-ui-react";
+import { Segment, Header, Image, Label, Icon, Modal, Comment, Divider } from "semantic-ui-react";
import Moment from "react-moment";
import "moment/locale/es";
const ImageModal = ({ href, trigger }) => (
- <Modal trigger={trigger}>
+ <Modal trigger={trigger} basic size="fullscreen">
<Modal.Content image>
- <Modal.Description>
- <Image as="a" src={href} fluid />
+ <Modal.Description style={{ "textAlign": "center" }}>
+ <Image as="a" src={href} />
</Modal.Description>
</Modal.Content>
</Modal>
);
-const Post = ({ index, post, locked, dir }) => {
+const Post = ({ index, post, locked, dir, threadId }) => {
const filesize = require('filesize');
+ const seedrandom = require("seedrandom");
+ const rng = seedrandom(threadId + index);
+ const avatar = ["1372836", "6396408", "anime_charhan02", "anime_jyorujyu01", "anime_monar05", "anime_sasuga04", "anime_zonu01", "fuun", "gocchin_face", "iyou", "kuma", "nurupo_ga_2", "u_naoruyo_bath", "1k", "6za", "anime_giko01", "anime_jyorujyu02", "anime_morara01", "anime_shii01", "anime_zonu02", "gaku", "gomiopen", "jisakujien_2", "kuma2", "onigiri_seito", "u_okotowari_a", "2-1", "8028885", "anime_giko04", "anime_jyorujyu03", "anime_morara02", "anime_shii02", "aramaki", "gaku2", "goo_1", "jisakujien_xmas", "maimai", "otiketu48", "u_sofa", "2ppa", "8toushinnomonar16", "anime_giko10", "anime_kukkuru01", "anime_morara04", "anime_shii03", "aroeri-na32", "gaku3", "goo_3", "kantoku1", "makotan2_folder", "pc3", "wakannai1", "2syobo_2", "8toushinnomonar32", "anime_giko11", "anime_kuma01", "anime_nokar01", "anime_syobon01", "asopasomaso", "gekisya1", "gya-", "kappappa1", "mona", "pgya", "yakimochi", "3", "ace", "anime_giko12", "anime_kumaface01", "anime_okashi01", "anime_syobon03", "bikyakusan32", "giko1", "hagenin-shuriken", "kasa-ri", "mona_shiri", "sasuga1", "youkan", "3-2", "af1", "anime_giko13", "anime_loop", "anime_okashi02", "anime_tarn01", "bs", "gikog_gomibako", "hagurumaou", "kashiwamo-chi32", "mona_tya", "seito_2", "zonu_1", "3na", "af2", "anime_hossyu01", "anime_marara02", "anime_onigiri04", "anime_uwan01", "button1_03", "gikog_gyunyupack", "hikky", "kinokorusensei32", "monaazarashi_1", "soon", "zuzagiko48", "4-2", "ahya_xmas_2", "anime_imanouchi01", "anime_matanki01", "anime_saitama01", "anime_uwan02", "buun", "gikog_pimiento", "hikky_xmas_2", "kita_", "namaetukenai", "tasukete", "4248688", "aka", "anime_iyou02", "anime_matanki02", "anime_saitama02", "anime_uwan03", "chahan", "gikoinu", "hyou", "kodomona", "naoruyo", "torimasu1", "5007629", "ame", "anime_jien01", "anime_miruna01", "anime_saitama03", "anime_youkanman01", "dokuo1", "gikoneko", "iirasan_face", "konkon_folder", "nida", "torimasu2", "5296219", "anime_buun02", "anime_jien02", "anime_monar02", "anime_sasuga01", "anime_youkanman02", "file2_01", "gikoneko_1", "imanouchi_1", "kossorisan", "nigete", "u_ame", "5ta", "anime_charhan01", "anime_jien03", "anime_monar03", "anime_sasuga03", "anime_youkanman03", "fujisan", "gikoneko2", "iyahoo", "kotatu", "nono_ie", "u_hoshi"];
let user_id = post.timestamp_formatted.split(" ID:")[1];
+ const i = Math.round(rng() * avatar.length);
+ const rndAvatar = avatar[i];
+
+ return (
+ <Comment>
+ <Comment.Avatar src={`https://bienvenidoainternet.org/static/ico/${rndAvatar}.gif`} />
+ <Comment.Content>
+ <Comment.Author>#{index + 1} <span className={post.email === "sage" ? "username sage" : "username"}>{post.name}</span><span className="tripcode">{post.tripcode}</span></Comment.Author>
+ <Comment.Metadata>
+ <Moment fromNow unix locale="es" date={post.timestamp} />
+ </Comment.Metadata>
+ <Comment.Text>
+ {post.file !== "" ?
+ <ImageModal href={`https://bienvenidoainternet.org/${dir}/src/${post.file}`} trigger={<Image className="postImage" src={`https://bienvenidoainternet.org/${dir}/thumb/${post.thumb}`} />} />
+ : null}
+ <div className={`postMessage ${dir === "zonavip" ? "vipFont" : null}`} dangerouslySetInnerHTML={{ __html: post.message }} />
+ </Comment.Text>
+ <Comment.Actions>
+ <Comment.Action>Responder</Comment.Action><Comment.Action>Reportar</Comment.Action>
+ </Comment.Actions>
+ </Comment.Content>
+ </Comment>
+ );
return (
<Segment.Group>