With Featured Comments :)

This commit is contained in:
Belen Curcio
2017-09-08 09:06:33 -03:00
parent 05d643d3c3
commit fd71acf7e0
8 changed files with 123 additions and 47 deletions
@@ -1,27 +0,0 @@
import React from 'react';
import cn from 'classnames';
import styles from './Button.css';
import {pluginName} from '../../package.json';
import {can} from 'plugin-api/beta/client/services';
import {withTags} from 'plugin-api/beta/client/hocs';
import {Icon} from 'plugin-api/beta/client/components/ui';
const Button = (props) => {
const {alreadyTagged, deleteTag, postTag, user} = props;
return can(user, 'MODERATE_COMMENTS') ? (
<button
className={cn([`${pluginName}-tag-button`, styles.button, {[styles.featured] : alreadyTagged}])}
onClick={alreadyTagged ? deleteTag : postTag} >
{alreadyTagged ?
<Icon name="star" className={styles.icon} /> :
<Icon name="star_border" className={styles.icon} />
}
</button>
) : null ;
};
export default withTags('featured')(Button);