Fixer pre/post

This commit is contained in:
Wyatt Johnson
2017-01-24 13:10:35 -07:00
parent eeaefd9656
commit cda768d694
17 changed files with 35 additions and 35 deletions
@@ -28,7 +28,7 @@ const updateCharCount = (updateSettings, settingsError) => (event) => {
};
const updateModeration = (updateSettings, mod) => () => {
const moderation = mod === 'pre' ? 'post' : 'pre';
const moderation = mod === 'PRE' ? 'POST' : 'PRE';
updateSettings({moderation});
};
@@ -70,15 +70,15 @@ const CommentSettings = ({fetchingSettings, title, updateSettings, settingsError
return (
<div className={styles.commentSettingsSection}>
<h3>{title}</h3>
<Card className={`${styles.configSetting} ${settings.moderation === 'pre' ? styles.enabledSetting : styles.disabledSetting}`}>
<Card className={`${styles.configSetting} ${settings.moderation === 'PRE' ? styles.enabledSetting : styles.disabledSetting}`}>
<div className={styles.action}>
<Checkbox
onChange={updateModeration(updateSettings, settings.moderation)}
checked={settings.moderation === 'pre'} />
checked={settings.moderation === 'PRE'} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{lang.t('configure.enable-pre-moderation')}</div>
<p className={settings.moderation === 'pre' ? '' : styles.disabledSettingText}>
<p className={settings.moderation === 'PRE' ? '' : styles.disabledSettingText}>
{lang.t('configure.enable-pre-moderation-text')}
</p>
</div>
@@ -14,7 +14,7 @@ class ConfigureStreamContainer extends Component {
super(props);
this.state = {
premod: props.config.moderation === 'pre',
premod: props.config.moderation === 'PRE',
premodLinks: false
};
@@ -26,7 +26,7 @@ class ConfigureStreamContainer extends Component {
handleApply () {
const {premod, changed} = this.state;
const newConfig = {
moderation: premod ? 'pre' : 'post'
moderation: premod ? 'PRE' : 'POST'
};
if (changed) {
this.props.updateConfiguration(newConfig);
+1 -1
View File
@@ -18,7 +18,7 @@ const buildOptions = (inputOptions = {}) => {
if (options._csrf) {
switch (options.method.toLowerCase()) {
case 'post':
case 'POST':
case 'put':
case 'delete':
options.headers['x-csrf-token'] = options._csrf;
+1 -1
View File
@@ -120,7 +120,7 @@ class CommentBox extends Component {
cStyle={!length || (charCount && length > charCount) ? 'lightGrey' : 'darkGrey'}
className={`${name}-button`}
onClick={this.postComment}>
{lang.t('post')}
{lang.t('POST')}
</Button>
)
}