Give descriptive key for slot elements and use it instead of talkPluginName

This commit is contained in:
Chi Vinh Le
2018-03-29 22:47:27 +02:00
parent 4a4c502fdd
commit 761e372016
9 changed files with 59 additions and 9247 deletions
@@ -4,8 +4,6 @@ import { t } from 'plugin-api/beta/client/services';
import styles from './TermsAndConditionsField.css';
import cn from 'classnames';
const pluginName = 'talk-plugin-auth-checkbox';
const TermsLink = () => (
<a
className={styles.link}
@@ -31,16 +29,15 @@ class TermsAndConditionsField extends React.Component {
id = 'terms-and-conditions';
componentWillMount() {
this.props.indicateBlockerOn(pluginName);
this.props.indicateBlocker();
}
onChange = ({ target: { checked } }) => {
this.setState({ checked });
if (checked) {
this.setState(() => ({ checked }));
this.props.indicateBlockerOff(pluginName);
this.props.indicateBlockerResolved();
} else {
this.setState(() => ({ checked }));
this.props.indicateBlockerOn(pluginName);
this.props.indicateBlocker();
}
};