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

Chat.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { JitsiModal } from '../../../base/modal';
  5. import { connect } from '../../../base/redux';
  6. import { CHAT_VIEW_MODAL_ID } from '../../constants';
  7. import AbstractChat, {
  8. _mapDispatchToProps,
  9. _mapStateToProps,
  10. type Props
  11. } from '../AbstractChat';
  12. import ChatInputBar from './ChatInputBar';
  13. import MessageContainer from './MessageContainer';
  14. import MessageRecipient from './MessageRecipient';
  15. /**
  16. * Implements a React native component that renders the chat window (modal) of
  17. * the mobile client.
  18. */
  19. class Chat extends AbstractChat<Props> {
  20. /**
  21. * Creates a new instance.
  22. *
  23. * @inheritdoc
  24. */
  25. constructor(props: Props) {
  26. super(props);
  27. this._onClose = this._onClose.bind(this);
  28. }
  29. /**
  30. * Implements React's {@link Component#render()}.
  31. *
  32. * @inheritdoc
  33. */
  34. render() {
  35. return (
  36. <JitsiModal
  37. headerProps = {{
  38. headerLabelKey: 'chat.title'
  39. }}
  40. modalId = { CHAT_VIEW_MODAL_ID }
  41. onClose = { this._onClose }>
  42. <MessageContainer messages = { this.props._messages } />
  43. <MessageRecipient />
  44. <ChatInputBar onSend = { this.props._onSendMessage } />
  45. </JitsiModal>
  46. );
  47. }
  48. _onClose: () => boolean
  49. /**
  50. * Closes the modal.
  51. *
  52. * @returns {boolean}
  53. */
  54. _onClose() {
  55. this.props._onToggleChat();
  56. return true;
  57. }
  58. }
  59. export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));