mirror of
https://github.com/wassname/talk.git
synced 2026-08-07 11:29:44 +08:00
Moving withTags to the plugin api, adding perms to Feature comments
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user