You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. } from '../AbstractMessageRecipient';
  10. /**
  11. * Class to implement the displaying of the recipient of the next message.
  12. */
  13. class MessageRecipient extends AbstractMessageRecipient {
  14. /**
  15. * Implements {@code PureComponent#render}.
  16. *
  17. * @inheritdoc
  18. */
  19. render() {
  20. const { _privateMessageRecipient } = this.props;
  21. if (!_privateMessageRecipient) {
  22. return null;
  23. }
  24. const { t } = this.props;
  25. return (
  26. <div id = 'chat-recipient'>
  27. <span>
  28. { t('chat.messageTo', {
  29. recipient: _privateMessageRecipient
  30. }) }
  31. </span>
  32. <div onClick = { this.props._onRemovePrivateMessageRecipient }>
  33. <Icon
  34. src = { IconCancelSelection } />
  35. </div>
  36. </div>
  37. );
  38. }
  39. }
  40. export default translate(connect(_mapStateToProps, _mapDispatchToProps)(MessageRecipient));