您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MessageRecipient.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { Icon, IconCancelSelection } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import AbstractMessageRecipient, {
  7. _mapDispatchToProps,
  8. _mapStateToProps,
  9. type Props
  10. } from '../AbstractMessageRecipient';
  11. /**
  12. * Class to implement the displaying of the recipient of the next message.
  13. */
  14. class MessageRecipient extends AbstractMessageRecipient<Props> {
  15. /**
  16. * Implements {@code PureComponent#render}.
  17. *
  18. * @inheritdoc
  19. */
  20. render() {
  21. const { _privateMessageRecipient } = this.props;
  22. if (!_privateMessageRecipient) {
  23. return null;
  24. }
  25. const { t } = this.props;
  26. return (
  27. <div id = 'chat-recipient'>
  28. <span>
  29. { t('chat.messageTo', {
  30. recipient: _privateMessageRecipient
  31. }) }
  32. </span>
  33. <div onClick = { this.props._onRemovePrivateMessageRecipient }>
  34. <Icon
  35. src = { IconCancelSelection } />
  36. </div>
  37. </div>
  38. );
  39. }
  40. }
  41. export default translate(connect(_mapStateToProps, _mapDispatchToProps)(MessageRecipient));