diff options
-rw-r--r-- | src/Post.js | 4 | ||||
-rw-r--r-- | src/Settings.js | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/Post.js b/src/Post.js index 5a938bf..d18f89c 100644 --- a/src/Post.js +++ b/src/Post.js @@ -271,6 +271,8 @@ class Post extends Component { let settingRenderAvatar = JSON.parse(localStorage.getItem("settings")) .showAvatars; + let settingEmbedYoutube = JSON.parse(localStorage.getItem("settings")) + .embedYoutube; return ( <Comment inverted={nightMode}> @@ -365,7 +367,7 @@ class Post extends Component { </div> ) : null} - {youtubeVideos !== null + {youtubeVideos !== null && settingEmbedYoutube ? youtubeVideos.map((url, i) => { let id = url.split("?v=")[1]; return ( diff --git a/src/Settings.js b/src/Settings.js index a0453af..8d187ae 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -34,7 +34,8 @@ class SettingsModal extends Component { notifyOnThread: true, autoUpdateThreads: true, showAvatars: true, - postPassword: "" + postPassword: "", + embedYoutube: true }; this.handleChange = this.handleChange.bind(this); this.toggleSetting = this.toggleSetting.bind(this); @@ -50,7 +51,8 @@ class SettingsModal extends Component { notifyOnThread: settings.notifyOnThread, autoUpdateThreads: settings.autoUpdateThreads, showAvatars: settings.showAvatars, - postPassword: settings.postPassword + postPassword: settings.postPassword, + embedYoutube: settings.embedYoutube }); } @@ -85,7 +87,8 @@ class SettingsModal extends Component { notifyOnHome, notifyOnThread, postPassword, - showAvatars + showAvatars, + embedYoutube } = this.state; return ( <Modal trigger={this.props.trigger} size="tiny" centered={false}> @@ -113,6 +116,13 @@ class SettingsModal extends Component { Comportamiento </Header> <Checkbox + label="Incrustar videos de Youtube" + checked={embedYoutube} + name="embedYoutube" + onChange={this.toggleSetting} + className="settingCheckbox" + /> + <Checkbox label="Actualizar automáticamente hilos" checked={autoUpdateThreads} name="autoUpdateThreads" |