aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-22 13:21:43 -0300
committerLibravatar Renard 2019-09-22 13:21:43 -0300
commitfecf0961c83538b36a2eb5195e21f13ad147821e (patch)
tree7552f7340de2793db3b7821f7f5fe7cbc180ebb0
parent5adcc8d6b34e0e2db145e5609248b477eaa16e0c (diff)
downloadbai-client-fecf0961c83538b36a2eb5195e21f13ad147821e.tar.gz
bai-client-fecf0961c83538b36a2eb5195e21f13ad147821e.tar.xz
bai-client-fecf0961c83538b36a2eb5195e21f13ad147821e.zip
QuickReply y Repor Modal
-rw-r--r--src/Post.js65
1 files changed, 62 insertions, 3 deletions
diff --git a/src/Post.js b/src/Post.js
index 6e09dd2..923fea7 100644
--- a/src/Post.js
+++ b/src/Post.js
@@ -6,11 +6,13 @@ import {
Comment,
Flag,
Embed,
- Label
+ Form,
+ Button
} from "semantic-ui-react";
import Moment from "react-moment";
import "moment/locale/es";
import { avatars } from "./Quotes";
+import ReplyForm from "./ReplyForm";
const ImageModal = ({ href, trigger }) => (
<Modal trigger={trigger} basic size="fullscreen">
@@ -22,6 +24,53 @@ const ImageModal = ({ href, trigger }) => (
</Modal>
);
+const ReportModal = ({ trigger, threadId, postId, dir }) => (
+ <Modal trigger={trigger} size="tiny">
+ <Modal.Header>Reportar</Modal.Header>
+ <Modal.Content>
+ <Modal.Description>
+ <p>
+ Para pedir que el post <b>#{postId}</b> sea eliminado, indica una
+ razón y presiona el botón Reportar.
+ </p>
+ <p>
+ Normalmente eliminamos los mensajes que son considerados spam o flood.
+ <br />
+ Si deseas pedir la prohibición de acceso a algún usuario persistente,
+ te recomendamos hacerlo en la sección /bai/.
+ </p>
+ <Form>
+ <Form.Field>
+ <Form.Input label="Razón" />
+ </Form.Field>
+ </Form>
+ </Modal.Description>
+ </Modal.Content>
+ <Modal.Actions>
+ <Button color="red">Reportar</Button>
+ </Modal.Actions>
+ </Modal>
+);
+
+const QuickReplyModal = ({ trigger, currentBoard, id, locked }) => (
+ <Modal trigger={trigger} size="tiny">
+ <Modal.Header>Respuesta rápida</Modal.Header>.
+ <Modal.Content>
+ <Modal.Description>
+ <ReplyForm
+ currentBoard={currentBoard}
+ parent={id}
+ locked={locked}
+ nightMode={false}
+ />
+ </Modal.Description>
+ </Modal.Content>
+ <Modal.Actions>
+ <Button secondary>Responder</Button>
+ </Modal.Actions>
+ </Modal>
+);
+
const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
if (post.IS_DELETED > 0) {
return (
@@ -183,8 +232,18 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
/>
</Comment.Text>
<Comment.Actions>
- {locked ? null : <Comment.Action>Responder</Comment.Action>}
- <Comment.Action>Reportar</Comment.Action>
+ {locked ? null : (
+ <QuickReplyModal
+ trigger={<Comment.Action>Responder</Comment.Action>}
+ currentBoard={currentBoard}
+ id={post.parentid}
+ locked={locked}
+ />
+ )}
+ <ReportModal
+ trigger={<Comment.Action>Reportar</Comment.Action>}
+ postId={post.id}
+ />
</Comment.Actions>
</Comment.Content>
</Comment>