import { Link } from 'react-router-dom'; import { injectIntl, defineMessages } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { autoPlayGif, me } from '../../initial_state'; import { makeGetAccount } from '../../selectors'; import Avatar from '../avatar'; import { shortNumberFormat } from '../../utils/numbers'; import './user_panel.scss'; const messages = defineMessages({ gabs: { id:'account.posts', defaultMessage: 'Gabs' }, followers: { id: 'account.followers', defaultMessage: 'Followers' }, follows: { id: 'account.follows', defaultMessage: 'Follows' } }); const mapStateToProps = state => { const getAccount = makeGetAccount(); return { account: getAccount(state, me), }; }; export default @connect(mapStateToProps) @injectIntl class UserPanel extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, intl: PropTypes.object.isRequired, } render() { const { account, intl } = this.props; const displayNameHtml = { __html: account.get('display_name_html') }; return (

@{account.get('acct')}

{shortNumberFormat(account.get('statuses_count'))} {intl.formatMessage(messages.gabs)}
{shortNumberFormat(account.get('followers_count'))} {intl.formatMessage(messages.followers)}
{shortNumberFormat(account.get('following_count'))} {intl.formatMessage(messages.follows)}
) } };