mirror of
https://github.com/ragestudio/comty.git
synced 2025-07-08 08:44:15 +00:00
Refactor FollowButton to use named function export
This commit is contained in:
parent
7206f00c00
commit
678c0c1a4c
@ -1,26 +1,28 @@
|
||||
import React from "react"
|
||||
import { Button } from "antd"
|
||||
import classnames from "classnames"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default (props) => {
|
||||
return <div className="followButton">
|
||||
const FollowButton = (props) => {
|
||||
return (
|
||||
<div className="followButton">
|
||||
<div className="counter">
|
||||
{props.count}
|
||||
{props.self && " Followers"}
|
||||
</div>
|
||||
{
|
||||
!props.self && <Button
|
||||
{!props.self && (
|
||||
<Button
|
||||
type="ghost"
|
||||
onClick={props.onClick}
|
||||
className={classnames(
|
||||
"btn",
|
||||
{ ["followed"]: props.followed }
|
||||
)}
|
||||
className={classnames("btn", {
|
||||
["followed"]: props.followed,
|
||||
})}
|
||||
>
|
||||
<span>{props.followed ? "Following" : "Follow"}</span>
|
||||
</Button>
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default FollowButton
|
||||
|
Loading…
x
Reference in New Issue
Block a user