Fully working, needs docs

This commit is contained in:
Belen Curcio
2017-06-06 11:58:51 -03:00
parent 9364272ffc
commit a6db60096c
4 changed files with 10 additions and 11 deletions
@@ -24,7 +24,7 @@ export default class ViewingOptions extends React.Component {
<a onClick={this.toggleOpen}>Viewing Options</a>
</div>
{
true ? (
this.state.open ? (
<div className={cn([styles.streamViewingOptionsList, 'streamViewingOptionsList'])}>
<ul>
{
@@ -1,11 +1,7 @@
import {ADD_CLASSNAME, REMOVE_CLASSNAME} from '../constants/comment';
const initialState = {
classNames: [{
'wapoOff' : {
tags: ['OFF_TOPIC']
}
}]
classNames: []
};
export default function comment (state = initialState, action) {
@@ -494,3 +494,7 @@ button.comment__action-button[disabled],
visibility: visible;
}
}
.offTopicComment {
display: none;
}
@@ -7,15 +7,14 @@ import {addClassName, removeClassName} from 'coral-embed-stream/src/actions/comm
class OffTopicFilter extends React.Component {
tag = 'OFF_TOPIC';
className = 'wapoOfftopic';
className = 'offTopicComment';
cn = {[this.className] : {tags: [this.tag]}};
handleChange = (e) => {
if (e.target.checked) {
this.props.addClassName({
[this.className] : {tags: [this.tag]}
});
this.props.addClassName(this.cn);
} else {
const idx = this.props.comment.classNames.indexOf(this.className);
const idx = this.props.comment.classNames.indexOf(this.cn);
this.props.removeClassName(idx);
}
}