diff --git a/packages/ui/src/ui/containers/SettingsMenu/SettingsMenuItem.js b/packages/ui/src/ui/containers/SettingsMenu/SettingsMenuItem.js index 45e912b08..5c699a789 100644 --- a/packages/ui/src/ui/containers/SettingsMenu/SettingsMenuItem.js +++ b/packages/ui/src/ui/containers/SettingsMenu/SettingsMenuItem.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; import PropTypes from 'prop-types'; import block from 'bem-cn-lite'; -import {Checkbox} from '@gravity-ui/uikit'; +import {Checkbox, Switch} from '@gravity-ui/uikit'; import {setSetting} from '../../store/actions/settings'; import {makeGetSetting} from '../../store/selectors/settings'; @@ -25,6 +25,8 @@ class SettingsMenuItem extends Component { annotationHighlight: PropTypes.string, oneLine: PropTypes.bool, + + useSwitch: PropTypes.bool, }; render() { @@ -37,6 +39,7 @@ class SettingsMenuItem extends Component { settingNS, label, oneLine, + useSwitch, } = this.props; const checked = getSetting(settingName, settingNS); @@ -49,11 +52,18 @@ class SettingsMenuItem extends Component { })} title={label} > - setSetting(settingName, settingNS, !checked)} - /> + {useSwitch ? ( + setSetting(settingName, settingNS, value)} + /> + ) : ( + setSetting(settingName, settingNS, value)} + /> + )}
{annotationHighlight && (