import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { NavLink } from 'react-router-dom' import ImmutablePropTypes from 'react-immutable-proptypes' import { defineMessages, injectIntl } from 'react-intl' import ImmutablePureComponent from 'react-immutable-pure-component' import { me } from '../initial_state' import { followAccount, unfollowAccount, blockAccount, unblockAccount, muteAccount, unmuteAccount, } from '../actions/accounts' import { openModal } from '../actions/modal' import { initMuteModal } from '../actions/mutes' import { unfollowModal } from '../initial_state' import { makeGetAccount } from '../selectors' import AccountActionButton from './account_action_button' import Avatar from './avatar' import DisplayName from './display_name' import Button from './button' import Text from './text' class Account extends ImmutablePureComponent { handleAction = (e) => { this.props.onActionClick(this.props.account, e) } handleUnrequest = () => { // } render() { const { account, intl, isHidden, onActionClick, actionIcon, actionTitle, compact, expanded, dismissAction, showDismiss, withBio, } = this.props if (!account) return null if (isHidden) { return ( {account.get('display_name')} {`@${account.get('username')}`} ) } const actionButton = (onActionClick && actionIcon) ? ( ) : const avatarSize = compact ? 42 : 52 const dismissBtn = !showDismiss ? null : (