From 9131d4ab9489c8a1abe05a701605c8348d6277a8 Mon Sep 17 00:00:00 2001 From: Renard Date: Tue, 1 Oct 2019 01:15:54 -0300 Subject: Avances creación de hilos --- src/NewThread.js | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/NewThread.js (limited to 'src/NewThread.js') diff --git a/src/NewThread.js b/src/NewThread.js new file mode 100644 index 0000000..c76f515 --- /dev/null +++ b/src/NewThread.js @@ -0,0 +1,122 @@ +import React, { Component } from "react"; +import { + Segment, + Button, + Form, + Icon, + Checkbox, + Header +} from "semantic-ui-react"; + +class NewThread extends Component { + constructor(props) { + super(props); + this.state = { + subject: "", + name: "", + email: "", + message: "", + attachment: "", + selectedFile: null, + isSpoiler: false + }; + this.handleChange = this.handleChange.bind(this); + } + + handleChange(e) { + const { name, value } = e.target; + this.setState({ [name]: value }); + } + + render() { + const { boardList, dir } = this.props; + const { + subject, + name, + email, + message, + attachment, + selectedFile, + isSpoiler + } = this.state; + const currentBoard = boardList.find(board => { + return board.dir === dir; + }); + + return ( + +
+ Crear un nuevo hilo en {currentBoard.name} +
+
+ {currentBoard.disable_subject === 0 && ( + + )} + + {currentBoard.disable_name === 0 && ( + + )} + + {currentBoard.allow_image_replies === 1 && ( + + + + + {selectedFile === null ? "Adjuntar archivo" : selectedFile} + + + )} + + + {currentBoard.allow_spoilers === 1 && ( + + )} + + +
+ ); + } +} + +export default NewThread; -- cgit v1.2.1-18-gbd029