Not connecting comment Component to the Store

This commit is contained in:
Belen Curcio
2017-06-06 17:09:13 -03:00
parent b5a64bd2f9
commit 4aa7900769
8 changed files with 29 additions and 21 deletions
@@ -18,14 +18,14 @@ class OffTopicFilter extends React.Component {
const idx = this.props.comment.classNames.indexOf(this.cn);
this.props.removeClassName(idx);
}
props.closeViewingOptions();
this.props.closeViewingOptions();
}
render() {
return (
<div className={styles.viewingOption}>
<label>
<input type="checkbox" onChange={this.handleChange}/>
<input type="checkbox" onChange={this.handleChange} checked={true}/>
Hide Off-Topic Comments
</label>
</div>
@@ -33,7 +33,7 @@ class OffTopicFilter extends React.Component {
}
}
const mapStateToProps = ({comment}) => ({comment});
const mapStateToProps = ({comment, offTopicFilter}) => ({comment, offTopicFilter});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({addClassName, removeClassName, closeViewingOptions}, dispatch);
@@ -2,9 +2,11 @@ import OffTopicCheckbox from './components/OffTopicCheckbox';
import OffTopicTag from './components/OffTopicTag';
import OffTopicFilter from './components/OffTopicFilter';
import translations from './translations.json';
import reducer from './reducer';
export default {
translations,
reducer,
slots: {
commentInputDetailArea: [OffTopicCheckbox],
streamViewingOptions: [OffTopicFilter],
@@ -0,0 +1,10 @@
const initialState = {
filter: true
};
export default function offTopic (state = initialState, action) {
switch (action.type) {
default :
return state;
}
}