aboutsummaryrefslogtreecommitdiff
path: root/src/Board.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-15 21:21:51 -0300
committerLibravatar Renard 2019-09-15 21:21:51 -0300
commite2a1bfd3d5fb5cbd7e9756de1f4f11b2e604064e (patch)
tree0b4bbe15018c7f094e689e951a9ec9507957fb2f /src/Board.js
parent4a39a75a5a8beda6b28b311c78990d72f1cfe7cf (diff)
downloadbai-client-e2a1bfd3d5fb5cbd7e9756de1f4f11b2e604064e.tar.gz
bai-client-e2a1bfd3d5fb5cbd7e9756de1f4f11b2e604064e.tar.xz
bai-client-e2a1bfd3d5fb5cbd7e9756de1f4f11b2e604064e.zip
Implementación de nuevo estilo de post en boards
Diffstat (limited to 'src/Board.js')
-rw-r--r--src/Board.js46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/Board.js b/src/Board.js
index daa2f39..6fece58 100644
--- a/src/Board.js
+++ b/src/Board.js
@@ -1,8 +1,9 @@
import React, { Component } from "react";
-import { Loader, Message, Segment, Header, Image, SegmentGroup } from "semantic-ui-react";
+import { Loader, Message, Segment, Header, Image, Comment } from "semantic-ui-react";
import { Link } from "@reach/router";
import Moment from "react-moment";
import "moment/locale/es";
+import Post from "./Post";
class Board extends Component {
constructor() {
super();
@@ -71,42 +72,15 @@ class Board extends Component {
<Segment.Group>
<Header as="h4" attached>
<Link to={`/${this.props.dir}/read/${thread.id}`}>{thread.subject}</Link>
- <Header.Subheader>
- {thread.name} ― <Moment fromNow unix locale="es" date={thread.timestamp} />
- </Header.Subheader>
</Header>
- <Segment.Group horizontal attached>
- {thread.file !== "" ?
- <Segment compact className="imageSegment">
- <Image size="small" src={`https://bienvenidoainternet.org/${this.props.dir}/thumb/${thread.thumb}`} />
- </Segment>
-
- : null}
- <Segment attached>
- <div dangerouslySetInnerHTML={{ __html: thread.message }} />
- </Segment>
- </Segment.Group>
-
- {thread.replies.map((reply, index, replies) =>
- <Segment.Group horizontal attached>
- {reply.file !== "" ?
- <Segment compact className="imageSegment">
- <Image size="small" fluid src={`https://bienvenidoainternet.org/${this.props.dir}/thumb/${reply.thumb}`} />
- </Segment>
- : null}
- <Segment attached>
-
- <Header key={index} as="h5">
- #{thread.total_replies - replies.length + index + 1} {reply.name}
- <Header.Subheader>
- <div className={`postMessage ${this.props.dir === "zonavip" ? "vipFont" : null}`} dangerouslySetInnerHTML={{ __html: reply.message }} />
- </Header.Subheader>
- </Header>
- </Segment>
- </Segment.Group>
-
- )}
-
+ <Segment>
+ <Comment.Group>
+ <Post index={0} post={thread} locked={thread.locked} threadId={thread.id} dir={this.props.dir} />
+ {thread.replies.map((reply, index, replies) =>
+ <Post index={thread.total_replies - replies.length + index + 1} post={reply} locked={thread.locked} threadId={thread.id} dir={this.props.dir} />
+ )}
+ </Comment.Group>
+ </Segment>
</Segment.Group>
)}
</div>