mirror of
https://github.com/wassname/talk.git
synced 2026-08-09 12:30:42 +08:00
Add premodLinks configuration
This commit is contained in:
@@ -8,7 +8,7 @@ import Configuration from './Configuration';
|
||||
|
||||
class Settings extends React.Component {
|
||||
render() {
|
||||
const {settings: {moderation}, toggleModeration} = this.props;
|
||||
const {settings: {moderation, premodLinksEnable}, toggleModeration, togglePremodLinks} = this.props;
|
||||
const changed = false;
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
@@ -32,6 +32,13 @@ class Settings extends React.Component {
|
||||
>
|
||||
{t('configure.enable_premod_description')}
|
||||
</Configuration>
|
||||
<Configuration
|
||||
checked={premodLinksEnable}
|
||||
title={t('configure.enable_premod_links')}
|
||||
onCheckbox={togglePremodLinks}
|
||||
>
|
||||
{t('configure.enable_premod_description')}
|
||||
</Configuration>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -41,6 +48,7 @@ class Settings extends React.Component {
|
||||
Settings.propTypes = {
|
||||
settings: PropTypes.object.isRequired,
|
||||
toggleModeration: PropTypes.func.isRequired,
|
||||
togglePremodLinks: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default Settings;
|
||||
|
||||
@@ -17,6 +17,11 @@ class SettingsContainer extends React.Component {
|
||||
this.props.updatePending({updater});
|
||||
};
|
||||
|
||||
togglePremodLinks = () => {
|
||||
const updater = {premodLinksEnable: {$set: !this.props.mergedSettings.premodLinksEnable}};
|
||||
this.props.updatePending({updater});
|
||||
};
|
||||
|
||||
savePending = async () => {
|
||||
try {
|
||||
await this.props.updateAssetSettings(this.props.asset.id, this.props.pending);
|
||||
@@ -32,6 +37,7 @@ class SettingsContainer extends React.Component {
|
||||
settings={this.props.mergedSettings}
|
||||
savePending={this.savePending}
|
||||
toggleModeration={this.toggleModeration}
|
||||
togglePremodLinks={this.togglePremodLinks}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
@@ -52,6 +58,7 @@ const withSettingsFragments = withFragments({
|
||||
id
|
||||
settings {
|
||||
moderation
|
||||
premodLinksEnable
|
||||
}
|
||||
}
|
||||
`,
|
||||
|
||||
Reference in New Issue
Block a user