jiti-meet/react/features/chat/components/native/Chat.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

// @flow
import React from 'react';
2020-04-01 15:14:02 +00:00
import { KeyboardAvoidingView } from 'react-native';
import { translate } from '../../../base/i18n';
2020-04-01 15:14:02 +00:00
import { JitsiModal } from '../../../base/modal';
2019-03-21 16:38:29 +00:00
import { connect } from '../../../base/redux';
2020-04-01 15:14:02 +00:00
import { CHAT_VIEW_MODAL_ID } from '../../constants';
import AbstractChat, {
_mapDispatchToProps,
2020-04-01 15:14:02 +00:00
_mapStateToProps,
type Props
} from '../AbstractChat';
import ChatInputBar from './ChatInputBar';
import MessageContainer from './MessageContainer';
2019-10-07 12:35:04 +00:00
import MessageRecipient from './MessageRecipient';
import styles from './styles';
/**
* Implements a React native component that renders the chat window (modal) of
* the mobile client.
*/
class Chat extends AbstractChat<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
*/
render() {
return (
2020-04-01 15:14:02 +00:00
<JitsiModal
headerLabelKey = 'chat.title'
modalId = { CHAT_VIEW_MODAL_ID }>
<KeyboardAvoidingView
behavior = 'padding'
style = { styles.chatContainer }>
2020-04-01 15:14:02 +00:00
<MessageContainer messages = { this.props._messages } />
<MessageRecipient />
<ChatInputBar onSend = { this.props._onSendMessage } />
</KeyboardAvoidingView>
2020-04-01 15:14:02 +00:00
</JitsiModal>
);
}
2019-10-15 14:08:23 +00:00
}
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));