import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { injectIntl, FormattedMessage } from 'react-intl'; import { autoPlayGif, me } from '../../../initial_state'; import { makeGetAccount } from '../../../selectors'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import Avatar from 'gabsocial/components/avatar'; import { shortNumberFormat } from 'gabsocial/utils/numbers'; class UserPanel extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, intl: PropTypes.object.isRequired, domain: PropTypes.string, } render() { const { account, intl, domain } = this.props; const displayNameHtml = { __html: account.get('display_name_html') }; const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct'); return (

@{acct}

{shortNumberFormat(account.get('statuses_count'))}
{shortNumberFormat(account.get('followers_count'))}
{shortNumberFormat(account.get('following_count'))}
) } }; const mapStateToProps = state => { const getAccount = makeGetAccount(); return { account: getAccount(state, me), }; }; export default injectIntl( connect(mapStateToProps, null, null, { forwardRef: true, } )(UserPanel))