diff options
author | Renard | 2019-09-16 19:14:19 -0300 |
---|---|---|
committer | Renard | 2019-09-16 19:14:19 -0300 |
commit | 4a84a4a9079bedc37a818df1645730fce1749ecb (patch) | |
tree | 7d11b2c0daacc28c859a596f734dc7de57e425d8 /src | |
parent | 75824bd139423d527820c81b60e0c43a6348e56f (diff) | |
download | bai-client-4a84a4a9079bedc37a818df1645730fce1749ecb.tar.gz bai-client-4a84a4a9079bedc37a818df1645730fce1749ecb.tar.xz bai-client-4a84a4a9079bedc37a818df1645730fce1749ecb.zip |
TODO: Archivos adjuntos
Diffstat (limited to 'src')
-rw-r--r-- | src/ReplyForm.js | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/ReplyForm.js b/src/ReplyForm.js index 1dab761..a9f461d 100644 --- a/src/ReplyForm.js +++ b/src/ReplyForm.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Form, Segment, Button, Message } from "semantic-ui-react"; +import { Form, Segment, Button, Message, Icon } from "semantic-ui-react"; import { quotes } from "./Quotes"; class ReplyForm extends Component { @@ -9,6 +9,7 @@ class ReplyForm extends Component { name: "", email: "", message: "", + attachment: "", submittedName: "", submittedEmail: "", submittedMessage: "", @@ -65,8 +66,14 @@ class ReplyForm extends Component { ); } + handleClick(e) { + e.preventDefault(); + document.getElementById("hiddenInput").click(); + } + render() { - const { name, email, message, replyRes } = this.state; + const { name, email, message, replyRes, attachment } = this.state; + const { currentBoard } = this.props; if (this.props.locked === 1) { return ( <Message negative> @@ -112,6 +119,22 @@ class ReplyForm extends Component { value={email} onChange={this.handleChange} /> + {/* TODO: Archivos adjuntos */} + {currentBoard.board_type === 0 && + currentBoard.allow_image_replies === 1 ? ( + <React.Fragment> + <input id="hiddenInput" type="file" hidden /> + <Form.Button + label="Adjunto" + fluid + value={attachment} + onClick={this.handleClick} + > + <Icon name="attach" /> + Adjuntar archivo + </Form.Button> + </React.Fragment> + ) : null} </Form.Group> <Form.TextArea name="message" |