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/App.css | 6 +++ src/App.js | 7 +++- src/NewThread.js | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Settings.js | 1 + 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/NewThread.js (limited to 'src') diff --git a/src/App.css b/src/App.css index 7bf667b..06ec594 100644 --- a/src/App.css +++ b/src/App.css @@ -191,4 +191,10 @@ .settingCheckbox { display: block !important; +} + +.spoilerCheckbox { + display: block !important; + margin-top: 1em; + margin-bottom: 1em; } \ No newline at end of file diff --git a/src/App.js b/src/App.js index c3631e2..9fffc93 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,7 @@ import ThreadList from "./ThreadList"; import FAQ from "./FAQ"; import ChangeLogPage from "./ChangelogPage"; import SettingsModal from "./Settings"; +import NewThread from "./NewThread"; class App extends Component { constructor() { @@ -193,7 +194,11 @@ class App extends Component { /> - + 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; diff --git a/src/Settings.js b/src/Settings.js index 7330cd4..a0453af 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -6,6 +6,7 @@ const notificationSounds = [ { key: "bongchime", value: "bongchime", text: "Bongchime" }, { key: "boombang", value: "boombang", text: "Boom bang!" }, { key: "chime", value: "chime", text: "Chime" }, + { key: "cuack", value: "cuack", text: "Cuack" }, { key: "dootdoot", value: "dootdoot", text: "Mr Skeltal - Doot doot" }, { key: "iqc", value: "iqc", text: "Notificación IQC" }, { key: "msn", value: "msn", text: "Notificación MSN" }, -- cgit v1.2.1-18-gbd029