2019-01-13 19:34:38 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
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';
|
2019-01-13 19:34:38 +00:00
|
|
|
|
|
|
|
import AbstractChat, {
|
|
|
|
_mapDispatchToProps,
|
2020-04-01 15:14:02 +00:00
|
|
|
_mapStateToProps,
|
|
|
|
type Props
|
2019-01-13 19:34:38 +00:00
|
|
|
} from '../AbstractChat';
|
|
|
|
|
2019-04-25 13:17:49 +00:00
|
|
|
import ChatInputBar from './ChatInputBar';
|
|
|
|
import MessageContainer from './MessageContainer';
|
2019-10-07 12:35:04 +00:00
|
|
|
import MessageRecipient from './MessageRecipient';
|
2019-01-13 19:34:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
2020-04-06 15:14:32 +00:00
|
|
|
headerProps = {{
|
|
|
|
headerLabelKey: 'chat.title'
|
|
|
|
}}
|
2020-04-01 15:14:02 +00:00
|
|
|
modalId = { CHAT_VIEW_MODAL_ID }>
|
2020-04-06 15:14:32 +00:00
|
|
|
<MessageContainer messages = { this.props._messages } />
|
|
|
|
<MessageRecipient />
|
|
|
|
<ChatInputBar onSend = { this.props._onSendMessage } />
|
2020-04-01 15:14:02 +00:00
|
|
|
</JitsiModal>
|
2019-01-13 19:34:38 +00:00
|
|
|
);
|
|
|
|
}
|
2019-10-15 14:08:23 +00:00
|
|
|
}
|
|
|
|
|
2019-01-13 19:34:38 +00:00
|
|
|
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));
|