diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js index 7bbecb319..60983b018 100644 --- a/client/coral-admin/src/routes/Moderation/components/Comment.js +++ b/client/coral-admin/src/routes/Moderation/components/Comment.js @@ -93,8 +93,10 @@ class Comment extends React.Component { + /> diff --git a/plugins/talk-plugin-featured-comments/client/components/ModTag.js b/plugins/talk-plugin-featured-comments/client/components/ModTag.js index 3595f23f5..f4dbcd614 100644 --- a/plugins/talk-plugin-featured-comments/client/components/ModTag.js +++ b/plugins/talk-plugin-featured-comments/client/components/ModTag.js @@ -2,9 +2,6 @@ import React from 'react'; import cn from 'classnames'; import styles from './ModTag.css'; import {t} from 'plugin-api/beta/client/services'; -import {isTagged} from 'plugin-api/beta/client/utils'; - -// import {isTagged} from 'plugin-api/beta/client/utils'; import {Icon} from 'plugin-api/beta/client/components/ui'; export default class ModTag extends React.Component { @@ -32,19 +29,21 @@ export default class ModTag extends React.Component { } render() { - const isFeatured = isTagged(this.props.comment.tags, 'FEATURED'); + const {alreadyTagged, deleteTag, postTag} = this.props; - return isFeatured ? ( + return alreadyTagged ? ( + onMouseLeave={this.handleMouseLeave} > {!this.state.on ? t('talk-plugin-featured-comments.featured') : t('talk-plugin-featured-comments.un_feature')} ) : ( - + - {isFeatured ? t('talk-plugin-featured-comments.featured') : t('talk-plugin-featured-comments.feature')} + {alreadyTagged ? t('talk-plugin-featured-comments.featured') : t('talk-plugin-featured-comments.feature')} ); } diff --git a/plugins/talk-plugin-featured-comments/client/containers/ModTag.js b/plugins/talk-plugin-featured-comments/client/containers/ModTag.js index 827bc1c9d..978700275 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/ModTag.js +++ b/plugins/talk-plugin-featured-comments/client/containers/ModTag.js @@ -1,15 +1,4 @@ -import {gql} from 'react-apollo'; import ModTag from '../components/ModTag'; -import {withFragments} from 'plugin-api/beta/client/hocs'; +import {withTags} from 'plugin-api/beta/client/hocs'; -export default withFragments({ - comment: gql` - fragment TalkFeaturedComments_ModTab_comment on Comment { - tags { - tag { - name - } - } - } - ` -})(ModTag); +export default withTags('featured')(ModTag);