From 536b2ed3710b9036ffdc7cebd21f4026de59f4f0 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 13:46:27 -0300 Subject: [PATCH] Liniting --- client/coral-plugin-commentbox/CommentBox.js | 1 - .../client/components/OffTopicCheckbox.js | 14 ++++++++------ .../client/components/OffTopicTag.js | 14 ++++++++++++-- services/comments.js | 15 ++++++++------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index d7d6fb00d..729472856 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -3,7 +3,6 @@ import {I18n} from '../coral-framework'; import translations from './translations.json'; import {Button} from 'coral-ui'; import {Slot} from 'coral-framework'; -import styles from './styles.css'; import merge from 'lodash/merge'; const name = 'coral-plugin-commentbox'; diff --git a/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js b/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js index 7354a841b..972ec7b6a 100644 --- a/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js +++ b/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js @@ -1,15 +1,20 @@ import React from 'react'; import styles from './styles.css'; +import {addCommentTag} from 'coral-framework/graphql/mutations'; +import {compose} from 'react-apollo'; class OffTopicCheckbox extends React.Component { handleChange = (e) => { - if (e.target.checked) { this.props.addCommentHooks({ postSubmit: { addTag: (data) => { - console.log('This is a hook after posting') + const {comment} = data.createComment; + this.props.addCommentTag({ + id: comment.id, + tag: 'OFF_TOPIC', + }); } } }) @@ -23,9 +28,6 @@ class OffTopicCheckbox extends React.Component { } render() { - - - return (