From f07060435055d327fcf86835c4850f9386a76242 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 30 Oct 2017 20:08:27 -0600 Subject: [PATCH] Rename SettingsCheckbox to be a bit more generic Splitting out the logic to two components doesn't make sense, but this isn't always a checkbox. Signed-off-by: Travis Ralston --- src/components/structures/UserSettings.js | 12 ++++++------ .../{SettingsCheckbox.js => SettingsFlag.js} | 2 +- .../views/room_settings/UrlPreviewSettings.js | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/components/views/elements/{SettingsCheckbox.js => SettingsFlag.js} (98%) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 9bd628ed15..64ee01a41c 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -664,10 +664,10 @@ module.exports = React.createClass({ }, _renderSyncedSetting: function(setting) { - const SettingsCheckbox = sdk.getComponent("elements.SettingsCheckbox"); + const SettingsFlag = sdk.getComponent("elements.SettingsFlag"); return (
- @@ -676,11 +676,11 @@ module.exports = React.createClass({ }, _renderThemeSelector: function(setting) { - const SettingsCheckbox = sdk.getComponent("elements.SettingsCheckbox"); + const SettingsFlag = sdk.getComponent("elements.SettingsFlag"); const onChange = (v) => dis.dispatch({action: 'set_theme', value: setting.value}); return (
- - diff --git a/src/components/views/elements/SettingsCheckbox.js b/src/components/views/elements/SettingsFlag.js similarity index 98% rename from src/components/views/elements/SettingsCheckbox.js rename to src/components/views/elements/SettingsFlag.js index a39b400183..59dae79e38 100644 --- a/src/components/views/elements/SettingsCheckbox.js +++ b/src/components/views/elements/SettingsFlag.js @@ -19,7 +19,7 @@ import SettingsStore from "../../../settings/SettingsStore"; import { _t } from '../../../languageHandler'; module.exports = React.createClass({ - displayName: 'SettingsCheckbox', + displayName: 'SettingsFlag', propTypes: { name: React.PropTypes.string.isRequired, level: React.PropTypes.string.isRequired, diff --git a/src/components/views/room_settings/UrlPreviewSettings.js b/src/components/views/room_settings/UrlPreviewSettings.js index cfd75537ef..580d2660d8 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.js +++ b/src/components/views/room_settings/UrlPreviewSettings.js @@ -34,7 +34,7 @@ module.exports = React.createClass({ }, render: function() { - const SettingsCheckbox = sdk.getComponent("elements.SettingsCheckbox"); + const SettingsFlag = sdk.getComponent("elements.SettingsFlag"); const roomId = this.props.room.roomId; let previewsForAccount = null; @@ -53,7 +53,7 @@ module.exports = React.createClass({ if (SettingsStore.canSetValue("urlPreviewsEnabled", roomId, "room")) { previewsForRoom = (