mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 10:37:10 +08:00
Adding respect count
This commit is contained in:
@@ -11,18 +11,21 @@ interface RespectButtonProps {
|
||||
|
||||
class RespectButton extends React.Component<RespectButtonProps> {
|
||||
public render() {
|
||||
return this.props.reacted ? (
|
||||
const { totalReactions, reacted } = this.props;
|
||||
return reacted ? (
|
||||
<Button variant="ghost" size="small" onClick={this.props.onButtonClick}>
|
||||
<MatchMedia gtWidth="xs">
|
||||
{!!totalReactions && <span>{totalReactions}</span>}
|
||||
<ButtonIcon>thumb_up_alt</ButtonIcon>
|
||||
</MatchMedia>
|
||||
<Localized id="comments-respectButton-respected">
|
||||
<span>{this.props.totalReactions} Respected</span>
|
||||
<span>Respected</span>
|
||||
</Localized>
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="ghost" size="small" onClick={this.props.onButtonClick}>
|
||||
<MatchMedia gtWidth="xs">
|
||||
{!!totalReactions && <span>{totalReactions}</span>}
|
||||
<ButtonIcon>thumb_up_alt</ButtonIcon>
|
||||
</MatchMedia>
|
||||
<Localized id="comments-respectButton-respect">
|
||||
|
||||
@@ -45,7 +45,7 @@ class RespectButtonContainer extends React.Component<
|
||||
this.props.comment.myActionPresence &&
|
||||
this.props.comment.myActionPresence.reaction;
|
||||
|
||||
console.log(this.props.comment);
|
||||
console.log(totalReactions);
|
||||
return (
|
||||
<RespectButton
|
||||
onButtonClick={this.onButtonClick}
|
||||
|
||||
Reference in New Issue
Block a user