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 { Button } from "antd"
|
||||||
import classnames from "classnames"
|
import classnames from "classnames"
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
export default (props) => {
|
const FollowButton = (props) => {
|
||||||
return <div className="followButton">
|
return (
|
||||||
<div className="counter">
|
<div className="followButton">
|
||||||
{props.count}
|
<div className="counter">
|
||||||
{props.self && " Followers"}
|
{props.count}
|
||||||
</div>
|
{props.self && " Followers"}
|
||||||
{
|
</div>
|
||||||
!props.self && <Button
|
{!props.self && (
|
||||||
type="ghost"
|
<Button
|
||||||
onClick={props.onClick}
|
type="ghost"
|
||||||
className={classnames(
|
onClick={props.onClick}
|
||||||
"btn",
|
className={classnames("btn", {
|
||||||
{ ["followed"]: props.followed }
|
["followed"]: props.followed,
|
||||||
)}
|
})}
|
||||||
>
|
>
|
||||||
<span>{props.followed ? "Following" : "Follow"}</span>
|
<span>{props.followed ? "Following" : "Follow"}</span>
|
||||||
</Button>
|
</Button>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default FollowButton
|
||||||
|
Loading…
x
Reference in New Issue
Block a user