Support for hooks, preSubmit and postSubmit

This commit is contained in:
Belen Curcio
2017-04-11 12:41:18 -03:00
parent 6aad4411d9
commit 014c23bb95
2 changed files with 57 additions and 4 deletions
@@ -3,14 +3,33 @@ import styles from './styles.css';
class OffTopicCheckbox extends React.Component {
handleChange = () => {
console.log('handle Change');
handleChange = (e) => {
if (e.target.checked) {
this.props.addCommentHooks({
postSubmit: {
addTag: (data) => {
console.log('This is a hook after posting')
}
}
})
} else {
this.props.addCommentHooks({
postSubmit: {
addTag: () => {}
}
})
}
}
render() {
return (
<div className={styles.offTopic}>
<label>
{/*{console.log(this.props)}*/}
<input type="checkbox" onChange={this.handleChange}/>
Off-Topic
</label>