mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Add setting to manage visibility of vote count, vote button and decide root page (#197)
This commit is contained in:
committed by
GitHub
parent
d4242dd78e
commit
e7335f5622
@@ -2,7 +2,9 @@ import * as React from 'react';
|
||||
|
||||
interface Props {
|
||||
postId: number;
|
||||
likesCount: number;
|
||||
likeCount: number;
|
||||
showLikeCount?: boolean;
|
||||
showLikeButton?: boolean;
|
||||
liked: number;
|
||||
handleLikeSubmit(
|
||||
postId: number,
|
||||
@@ -15,7 +17,9 @@ interface Props {
|
||||
|
||||
const LikeButtonP = ({
|
||||
postId,
|
||||
likesCount,
|
||||
likeCount,
|
||||
showLikeCount = true,
|
||||
showLikeButton = true,
|
||||
liked,
|
||||
handleLikeSubmit,
|
||||
authenticityToken,
|
||||
@@ -29,9 +33,10 @@ const LikeButtonP = ({
|
||||
else window.location.href = `/users/sign_in`;
|
||||
}}
|
||||
className={`likeButton${liked ? ' liked' : ''}`}
|
||||
hidden={!showLikeButton}
|
||||
>
|
||||
</div>
|
||||
<span className="likesCountLabel">{likesCount}</span>
|
||||
{ showLikeCount && <span className="likeCountLabel">{likeCount}</span> }
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user