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'; export default @injectIntl class ReplyMentions extends ImmutablePureComponent { static propTypes = { onOpenMentionsModal: PropTypes.func.isRequired, explicitAddressing: PropTypes.bool, to: ImmutablePropTypes.orderedSet, parentTo: ImmutablePropTypes.orderedSet, isReply: PropTypes.bool, }; handleClick = e => { e.preventDefault(); this.props.onOpenMentionsModal(); } render() { const { explicitAddressing, to, parentTo, isReply } = this.props; if (!explicitAddressing || !isReply || !to || (parentTo.size === 0)) { return null; } if (to.size === 0) { return ( ); } return ( <>@{acct.split('@')[0]}{' '}), more: to.size > 2 && , }} /> ); } }