diff options
author | Renard | 2019-09-12 15:40:15 -0300 |
---|---|---|
committer | Renard | 2019-09-12 15:40:15 -0300 |
commit | 87f100049cb00ab809396addf7e1f868ea3fea02 (patch) | |
tree | f74bc1e04ee3eb8885317065d7332fd8d9fdbea1 /src/Post.js | |
parent | af2f88977629e26c8c7c2fbbda8b6d6c5ebf1bff (diff) | |
download | bai-client-87f100049cb00ab809396addf7e1f868ea3fea02.tar.gz bai-client-87f100049cb00ab809396addf7e1f868ea3fea02.tar.xz bai-client-87f100049cb00ab809396addf7e1f868ea3fea02.zip |
Post as object
Diffstat (limited to 'src/Post.js')
-rw-r--r-- | src/Post.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Post.js b/src/Post.js new file mode 100644 index 0000000..99eadb5 --- /dev/null +++ b/src/Post.js @@ -0,0 +1,36 @@ +import React from "react"; +import { Segment, Header, Image, Label, Icon } from "semantic-ui-react"; +import Moment from "react-moment"; +import "moment/locale/es"; + +const Post = ({ index, post, locked, dir }) => { + const filesize = require('filesize'); + return ( + <Segment.Group> + <Header as="h5" attached> + #{index + 1} {post.name} + <Header.Subheader className="inlineSubHeader"> + <Moment fromNow unix locale="es" date={post.timestamp} /> + </Header.Subheader> + </Header> + + <Segment.Group horizontal> + {post.file != "" ? + <Segment padded compact className="imageSegment"> + <Label attached='bottom'>{post.file} {post.image_width}x{post.image_height} {filesize(post.file_size, { bits: true })}</Label> + <Image fluid src={`https://bienvenidoainternet.org/${dir}/thumb/${post.thumb}`} /> + + </Segment> : null} + <Segment padded> + + <div className={`postMessage ${dir === "zonavip" ? "vipFont" : null}`} dangerouslySetInnerHTML={{ __html: post.message }} /> + {locked ? null : + (<Label attached='bottom right'> + <Icon name="reply" />Responder + </Label>)} + </Segment> + </Segment.Group> + </Segment.Group>); +} + +export default Post;
\ No newline at end of file |