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,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import styles from './styles.css';
|
||||
import {withReaction} from 'plugin-api/beta/client/hocs';
|
||||
import {t} from 'plugin-api/beta/client/services';
|
||||
import {Icon} from 'plugin-api/beta/client/components/ui';
|
||||
import { withReaction } from 'plugin-api/beta/client/hocs';
|
||||
import { t } from 'plugin-api/beta/client/services';
|
||||
import { Icon } from 'plugin-api/beta/client/components/ui';
|
||||
import cn from 'classnames';
|
||||
|
||||
const plugin = 'talk-plugin-like';
|
||||
@@ -31,15 +31,23 @@ class LikeButton extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {count, alreadyReacted} = this.props;
|
||||
const { count, alreadyReacted } = this.props;
|
||||
return (
|
||||
<div className={cn(styles.container, `${plugin}-container`)}>
|
||||
<button
|
||||
className={cn(styles.button, {[`${styles.liked} talk-plugin-like-liked`]: alreadyReacted}, `${plugin}-button`)}
|
||||
className={cn(
|
||||
styles.button,
|
||||
{ [`${styles.liked} talk-plugin-like-liked`]: alreadyReacted },
|
||||
`${plugin}-button`
|
||||
)}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<span className={cn(`${plugin}-label`, styles.label)}>
|
||||
{t(alreadyReacted ? 'talk-plugin-like.liked' : 'talk-plugin-like.like')}
|
||||
{t(
|
||||
alreadyReacted
|
||||
? 'talk-plugin-like.liked'
|
||||
: 'talk-plugin-like.like'
|
||||
)}
|
||||
</span>
|
||||
<Icon name="thumb_up" className={cn(`${plugin}-icon`, styles.icon)} />
|
||||
<span className={`${plugin}-count`}>{count > 0 && count}</span>
|
||||
|
||||
@@ -4,6 +4,6 @@ import translations from './translations.yml';
|
||||
export default {
|
||||
translations,
|
||||
slots: {
|
||||
commentReactions: [LikeButton]
|
||||
commentReactions: [LikeButton],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
const {getReactionConfig} = require('../../plugin-api/beta/server');
|
||||
const { getReactionConfig } = require('../../plugin-api/beta/server');
|
||||
module.exports = getReactionConfig('like');
|
||||
|
||||
Reference in New Issue
Block a user