Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

MessageRecipient.js 1.5KB

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