From cab0f47a612a8e2659581d0e1d8645ffa32321c6 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Sat, 3 Jun 2017 21:40:24 +0900 Subject: [PATCH] Change toggle state when click label (#3530) --- .../notifications/components/setting_toggle.js | 12 ++++++------ app/javascript/styles/components.scss | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/javascript/mastodon/features/notifications/components/setting_toggle.js b/app/javascript/mastodon/features/notifications/components/setting_toggle.js index 6a42f7c753..a37abbd9c2 100644 --- a/app/javascript/mastodon/features/notifications/components/setting_toggle.js +++ b/app/javascript/mastodon/features/notifications/components/setting_toggle.js @@ -10,7 +10,6 @@ class SettingToggle extends React.PureComponent { settingKey: PropTypes.array.isRequired, label: PropTypes.node.isRequired, onChange: PropTypes.func.isRequired, - htmlFor: PropTypes.string, } onChange = (e) => { @@ -18,13 +17,14 @@ class SettingToggle extends React.PureComponent { } render () { - const { settings, settingKey, label, onChange, htmlFor = '' } = this.props; + const { settings, settingKey, label, onChange } = this.props; + const id = `setting-toggle-${settingKey.join('-')}`; return ( - +
+ + +
); } diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index e396f04cc1..a617052827 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -2172,13 +2172,12 @@ button.icon-button.active i.fa-retweet { left: 20px; } -.setting-toggle__label { +.setting-toggle { display: block; line-height: 24px; - vertical-align: middle; } -.setting-toggle { +.setting-toggle__label { color: $ui-primary-color; display: inline-block; margin-bottom: 14px;