Setting / Privacy: Do not show sensitive content checkbox if not allowed

This commit is contained in:
Alexander Zinchuk 2021-07-02 11:47:15 +03:00
parent e8c79aee81
commit cbf2fcf72f

View File

@ -180,18 +180,20 @@ const SettingsPrivacy: FC<OwnProps & StateProps & DispatchProps> = ({
</ListItem>
</div>
<div className="settings-item">
<h4 className="settings-item-header" dir={lang.isRtl ? 'rtl' : undefined}>
{lang('lng_settings_sensitive_title')}
</h4>
<Checkbox
label={lang('lng_settings_sensitive_disable_filtering')}
subLabel={lang('lng_settings_sensitive_about')}
checked={Boolean(isSensitiveEnabled)}
disabled={!canChangeSensitive}
onCheck={updateContentSettings}
/>
</div>
{canChangeSensitive && (
<div className="settings-item">
<h4 className="settings-item-header" dir={lang.isRtl ? 'rtl' : undefined}>
{lang('lng_settings_sensitive_title')}
</h4>
<Checkbox
label={lang('lng_settings_sensitive_disable_filtering')}
subLabel={lang('lng_settings_sensitive_about')}
checked={Boolean(isSensitiveEnabled)}
disabled={!canChangeSensitive}
onCheck={updateContentSettings}
/>
</div>
)}
</div>
);
};