import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { getSettings } from 'soapbox/actions/settings'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display_name'; import Permalink from 'soapbox/components/permalink'; import RelativeTimestamp from 'soapbox/components/relative_timestamp'; import { Text } from 'soapbox/components/ui'; import ActionButton from 'soapbox/features/ui/components/action_button'; import { makeGetAccount } from 'soapbox/selectors'; import { shortNumberFormat } from 'soapbox/utils/numbers'; import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types'; const makeMapStateToProps = () => { const getAccount = makeGetAccount(); const mapStateToProps = (state, { id }) => ({ me: state.get('me'), account: getAccount(state, id), autoPlayGif: getSettings(state).get('autoPlayGif'), }); return mapStateToProps; }; export default @injectIntl @connect(makeMapStateToProps) class AccountCard extends ImmutablePureComponent { static propTypes = { me: SoapboxPropTypes.me, account: ImmutablePropTypes.record.isRequired, autoPlayGif: PropTypes.bool, }; render() { const { account, autoPlayGif, me } = this.props; const followedBy = me !== account.get('id') && account.getIn(['relationship', 'followed_by']); return (