From 8d4c0c672145535b104a56ec7d66d974b7687221 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Thu, 13 Jul 2017 12:15:13 -0300 Subject: [PATCH] WIP --- plugin-api/beta/client/hocs/withTags.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugin-api/beta/client/hocs/withTags.js b/plugin-api/beta/client/hocs/withTags.js index 7dff93f65..6d0ed920c 100644 --- a/plugin-api/beta/client/hocs/withTags.js +++ b/plugin-api/beta/client/hocs/withTags.js @@ -27,7 +27,10 @@ export default (tag) => (WrappedComponent) => { } } `; - + + const isTagged = (tags) => + !!tags.filter((t) => t.tag.name === Tag.toUpperCase()).length; + const withAddTag = withMutation( gql` mutation AddTag($id: ID!, $asset_id: ID!, $name: String!) { @@ -112,7 +115,7 @@ export default (tag) => (WrappedComponent) => { class WithTags extends React.Component { - postTag = () => { + postTag() { const {comment, asset} = this.props; this.props.addTag({ @@ -122,7 +125,7 @@ export default (tag) => (WrappedComponent) => { }); } - deleteTag = () => { + deleteTag() { const {comment, asset} = this.props; this.props.removeTag({ @@ -135,8 +138,6 @@ export default (tag) => (WrappedComponent) => { render() { const {comment} = this.props; - const isTagged = (tags) => !!tags.filter((t) => t.tag.name === Tag.toUpperCase()).length; - const alreadyTagged = isTagged(comment.tags); return