mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Not connecting comment Component to the Store
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user