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.

Chat.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // @flow
  2. import React from 'react';
  3. import { KeyboardAvoidingView } from 'react-native';
  4. import { translate } from '../../../base/i18n';
  5. import { JitsiModal } from '../../../base/modal';
  6. import { connect } from '../../../base/redux';
  7. import { CHAT_VIEW_MODAL_ID } from '../../constants';
  8. import AbstractChat, {
  9. _mapDispatchToProps,
  10. _mapStateToProps,
  11. type Props
  12. } from '../AbstractChat';
  13. import ChatInputBar from './ChatInputBar';
  14. import MessageContainer from './MessageContainer';
  15. import MessageRecipient from './MessageRecipient';
  16. import styles from './styles';
  17. /**
  18. * Implements a React native component that renders the chat window (modal) of
  19. * the mobile client.
  20. */
  21. class Chat extends AbstractChat<Props> {
  22. /**
  23. * Implements React's {@link Component#render()}.
  24. *
  25. * @inheritdoc
  26. */
  27. render() {
  28. return (
  29. <JitsiModal
  30. headerLabelKey = 'chat.title'
  31. modalId = { CHAT_VIEW_MODAL_ID }>
  32. <KeyboardAvoidingView
  33. behavior = 'padding'
  34. style = { styles.chatContainer }>
  35. <MessageContainer messages = { this.props._messages } />
  36. <MessageRecipient />
  37. <ChatInputBar onSend = { this.props._onSendMessage } />
  38. </KeyboardAvoidingView>
  39. </JitsiModal>
  40. );
  41. }
  42. }
  43. export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));