added comments counter

This commit is contained in:
SrGooglo 2023-03-03 19:27:28 +00:00
parent c13a70a3b2
commit 8e6f8a8a56
3 changed files with 35 additions and 5 deletions

View File

@ -0,0 +1,21 @@
import React from "react"
import { Button } from "antd"
import { Icons } from "components/Icons"
import "./index.less"
export default (props) => {
return <div
className="comments_button"
>
<Button
type="ghost"
shape="circle"
onClick={props.onClickComments}
icon={<Icons.MessageCircle />}
/>
{
props.count > 0 && <span className="comments_count">{props.count}</span>
}
</div>
}

View File

@ -0,0 +1,10 @@
.comments_button {
display: inline-flex;
flex-direction: row;
align-items: center;
.comments_count {
font-size: 0.8rem;
}
}

View File

@ -4,6 +4,7 @@ import { Icons } from "components/Icons"
import SaveButton from "./saveButton"
import LikeButton from "./likeButton"
import CommentsButton from "./commentsButton"
import "./index.less"
@ -51,11 +52,9 @@ export default (props) => {
/>
</div>
<div className="action" id="comments">
<Button
type="ghost"
shape="circle"
onClick={props.onClickComments}
icon={<Icons.MessageCircle />}
<CommentsButton
onClickComments={props.onClickComments}
count={props.commentsCount}
/>
</div>
<div className="action" id="more">