mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
replaced eslint:recommended with prettier
This commit is contained in:
@@ -1,25 +1,29 @@
|
||||
import React from 'react';
|
||||
import cn from 'classnames';
|
||||
import styles from './FeaturedButton.css';
|
||||
import {pluginName} from '../../package.json';
|
||||
import {can} from 'plugin-api/beta/client/services';
|
||||
import {Icon} from 'plugin-api/beta/client/components/ui';
|
||||
import { pluginName } from '../../package.json';
|
||||
import { can } from 'plugin-api/beta/client/services';
|
||||
import { Icon } from 'plugin-api/beta/client/components/ui';
|
||||
|
||||
const FeaturedButton = (props) => {
|
||||
const {alreadyTagged, deleteTag, postTag, user} = props;
|
||||
const FeaturedButton = 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} /> :
|
||||
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 ;
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default FeaturedButton;
|
||||
|
||||
Reference in New Issue
Block a user