Moving withTags to the plugin api, adding perms to Feature comments

This commit is contained in:
Belen Curcio
2017-07-03 11:55:09 -03:00
parent 23ebe9f8e3
commit fbdb044551
3 changed files with 6 additions and 5 deletions
+1
View File
@@ -1 +1,2 @@
export {default as withReaction} from './withReaction';
export {default as withTags} from './withTags';
@@ -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') ? (
<button
className={cn([name, styles.button, {[styles.featured] : alreadyTagged}])}
onClick={alreadyTagged ? deleteTag : postTag} >
@@ -25,7 +25,7 @@ const FeaturedButton = (props) => {
)}
</button>
);
) : null ;
};
export default withTags('featured')(FeaturedButton);