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;