import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import IconButton from 'soapbox/components/icon_button'; import { statusToMentionsAccountIdsArray } from 'soapbox/reducers/compose'; import { makeGetStatus } from 'soapbox/selectors'; import Account from '../../reply_mentions/account'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, confirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, }); const makeMapStateToProps = () => { const getStatus = makeGetStatus(); return state => { const status = getStatus(state, { id: state.getIn(['compose', 'in_reply_to']) }); if (!status) { return { isReply: false, }; } const me = state.get('me'); const account = state.getIn(['accounts', me]); const mentions = statusToMentionsAccountIdsArray(state, status, account); return { mentions, author: status.getIn(['account', 'id']), to: state.getIn(['compose', 'to']), isReply: true, }; }; }; class ComposeModal extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, author: PropTypes.string, intl: PropTypes.object.isRequired, onClose: PropTypes.func.isRequired, inReplyTo: PropTypes.string, dispatch: PropTypes.func.isRequired, }; onClickClose = () => { const { onClose, onCancel } = this.props; onClose('COMPOSE'); if (onCancel) onCancel(); }; render() { const { intl, mentions, author } = this.props; return (

{mentions.map(accountId => )}
); } } export default injectIntl(connect(makeMapStateToProps)(ComposeModal));