From e2a1bfd3d5fb5cbd7e9756de1f4f11b2e604064e Mon Sep 17 00:00:00 2001 From: Renard Date: Sun, 15 Sep 2019 21:21:51 -0300 Subject: Implementación de nuevo estilo de post en boards --- src/App.css | 25 +++++++++++++++++++++++++ src/Board.js | 46 ++++++++++------------------------------------ src/Post.js | 41 ++++++++++------------------------------- 3 files changed, 45 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/App.css b/src/App.css index bdeb084..07441e4 100644 --- a/src/App.css +++ b/src/App.css @@ -42,5 +42,30 @@ .postImage { padding-top: 0.5em; + padding-bottom: 0.5em; +} + +.imageContainer { + display: inline-block; + text-align: center; + font-size: 0.75em; padding-bottom: 1em; +} + +.yt { + border: 1px solid #ccc; + font-size: 12px; + display: inline-block; + line-height: 13px; + margin: 2px 0; + padding: 5px; + text-decoration: none; +} + +.yt .pvw { + width: 100px; + height: 60px; + overflow: hidden; + float: left; + margin-right: 5px; } \ No newline at end of file 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 {
{thread.subject} - - {thread.name} ― -
- - {thread.file !== "" ? - - - - - : null} - -
- - - - {thread.replies.map((reply, index, replies) => - - {reply.file !== "" ? - - - - : null} - - -
- #{thread.total_replies - replies.length + index + 1} {reply.name} - -
- -
-
-
- - )} - + + + + {thread.replies.map((reply, index, replies) => + + )} + + )}
diff --git a/src/Post.js b/src/Post.js index 2525184..e175f91 100644 --- a/src/Post.js +++ b/src/Post.js @@ -14,6 +14,10 @@ const ImageModal = ({ href, trigger }) => ( ); const Post = ({ index, post, locked, dir, threadId }) => { + if (post.IS_DELETED > 0) { + return null; + } + console.log(post); const filesize = require('filesize'); const seedrandom = require("seedrandom"); const rng = seedrandom(threadId + index); @@ -28,11 +32,15 @@ const Post = ({ index, post, locked, dir, threadId }) => { #{index + 1} {post.name}{post.tripcode} - +
+
{user_id}
{post.file !== "" ? - } /> +
+ } /> + {post.file} {post.image_width}x{post.image_height} {filesize(post.file_size, { bits: true })} +
: null}
@@ -42,35 +50,6 @@ const Post = ({ index, post, locked, dir, threadId }) => { ); - - return ( - -
- #{index + 1} {post.name}{post.tripcode} - - - - - {user_id ? : null} -
- - - {post.file !== "" ? - - - } /> - : null} - -
- {locked ? null : - ()} - - - ); } export default Post; \ No newline at end of file -- cgit v1.2.1-18-gbd029