From fecf0961c83538b36a2eb5195e21f13ad147821e Mon Sep 17 00:00:00 2001
From: Renard
Date: Sun, 22 Sep 2019 13:21:43 -0300
Subject: QuickReply y Repor Modal

---
 src/Post.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 62 insertions(+), 3 deletions(-)

(limited to 'src')

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>
-- 
cgit v1.2.1-18-gbd029