Ádd classnames based on tags

This commit is contained in:
Belen Curcio
2017-06-06 11:53:19 -03:00
parent 9e001f5ce9
commit 9364272ffc
4 changed files with 43 additions and 5 deletions
@@ -6,11 +6,14 @@ import {addClassName, removeClassName} from 'coral-embed-stream/src/actions/comm
class OffTopicFilter extends React.Component {
className = 'OFF_TOPIC';
tag = 'OFF_TOPIC';
className = 'wapoOfftopic';
handleChange = (e) => {
if (e.target.checked) {
this.props.addClassName(this.className);
this.props.addClassName({
[this.className] : {tags: [this.tag]}
});
} else {
const idx = this.props.comment.classNames.indexOf(this.className);
this.props.removeClassName(idx);