diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-10-15 16:24:47 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-10-21 21:49:46 +0200 |
commit | 4ae4b0397430230d9d6fdf139ae59e2637859d13 (patch) | |
tree | c4b0914b5578e1297fbc277250303f97bd8f0714 /app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js | |
parent | dca05c79a96607d5575b43a310624ca2607ab3d5 (diff) |
[Glitch] Change how missing desktop notifications permission is displayed
Port a69ca294738dbe22bacaf9f1fc5a551d99797b35 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js index 0264b6815..e472f7c4f 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js +++ b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js @@ -13,6 +13,7 @@ export default class SettingToggle extends React.PureComponent { meta: PropTypes.node, onChange: PropTypes.func.isRequired, defaultValue: PropTypes.bool, + disabled: PropTypes.bool, } onChange = ({ target }) => { @@ -20,12 +21,12 @@ export default class SettingToggle extends React.PureComponent { } render () { - const { prefix, settings, settingPath, label, meta, defaultValue } = this.props; + const { prefix, settings, settingPath, label, meta, defaultValue, disabled } = this.props; const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-'); return ( <div className='setting-toggle'> - <Toggle id={id} checked={settings.getIn(settingPath, defaultValue)} onChange={this.onChange} onKeyDown={this.onKeyDown} /> + <Toggle disabled={disabled} id={id} checked={settings.getIn(settingPath, defaultValue)} onChange={this.onChange} onKeyDown={this.onKeyDown} /> <label htmlFor={id} className='setting-toggle__label'>{label}</label> {meta && <span className='setting-meta__label'>{meta}</span>} </div> |