import React, { Component } from "react";
import { Row, Col } from "antd";
import intl from "react-intl-universal";
import "./AvatarHoverCard.less";
class AvatarHoverCard extends Component {
constructor(props) {
super(props);
this.state = {
showModal: false
};
}
componentDidMount() {
this.props.getUserInfo({
id: this.props.user_id
});
}
render() {
const { image, user_id, currentUser, userAvaHoverData } = this.props;
const followed =
userAvaHoverData[user_id] && userAvaHoverData[user_id].isFollowed;
return (
e.stopPropagation()}>
{/*
*/}
{userAvaHoverData[user_id] && userAvaHoverData[user_id].nickname}
{/* */}
{userAvaHoverData[user_id] && userAvaHoverData[user_id].fans}
{intl.get("bilingually.fan", {
ext:
userAvaHoverData[user_id] &&
userAvaHoverData[user_id].fans > 1
? "s"
: ""
})}
{userAvaHoverData[user_id] && userAvaHoverData[user_id].followers}
{intl.get("bilingually.follow", {
ext:
userAvaHoverData[user_id] &&
userAvaHoverData[user_id].followers > 1
? "s"
: ""
})}
{currentUser.user_id !== user_id && (
{followed ? (
{
e.stopPropagation();
this.props
.unFocus({
id: user_id
})
.then(() => {
this.props.getUserInfo({
id: user_id
});
});
}}
>
{intl.get("bilingually.cancel_follow")}
) : (
{
e.stopPropagation();
this.props.focus({ id: user_id }).then(() => {
this.props.getUserInfo({
id: user_id
});
});
}}
>
{intl.get("bilingually.follow", { ext: "" })}
)}
{/* 发私信按钮,暂时隐藏 */}
{/*
发私信
*/}
)}
);
}
}
export default AvatarHoverCard;