diff --git a/plugin-api/beta/client/hocs/index.js b/plugin-api/beta/client/hocs/index.js index 7be682670..fc3150352 100644 --- a/plugin-api/beta/client/hocs/index.js +++ b/plugin-api/beta/client/hocs/index.js @@ -1 +1,2 @@ export {default as withReaction} from './withReaction'; +export {default as withTags} from './withTags'; diff --git a/plugins/talk-plugin-featured-comments/client/components/withTags.js b/plugin-api/beta/client/hocs/withTags.js similarity index 100% rename from plugins/talk-plugin-featured-comments/client/components/withTags.js rename to plugin-api/beta/client/hocs/withTags.js diff --git a/plugins/talk-plugin-featured-comments/client/components/FeaturedButton.js b/plugins/talk-plugin-featured-comments/client/components/FeaturedButton.js index 0e68b8b70..54546eb63 100644 --- a/plugins/talk-plugin-featured-comments/client/components/FeaturedButton.js +++ b/plugins/talk-plugin-featured-comments/client/components/FeaturedButton.js @@ -1,15 +1,15 @@ import React from 'react'; -import withTags from './withTags'; import styles from './styles.css'; import cn from 'classnames'; -import {t} from 'plugin-api/beta/client/services'; +import {t, can} from 'plugin-api/beta/client/services'; import {name} from '../../package.json'; +import {withTags} from 'plugin-api/beta/client/hocs'; import {Icon} from 'plugin-api/beta/client/components/ui'; const FeaturedButton = (props) => { - const {alreadyTagged, deleteTag, postTag} = props; + const {alreadyTagged, deleteTag, postTag, user} = props; - return ( + return can(user, 'MODERATE_COMMENTS') ? ( - ); + ) : null ; }; export default withTags('featured')(FeaturedButton);