// @flow import React from 'react'; import { View } from 'react-native'; import { Button } from 'react-native-paper'; import { translate } from '../../../base/i18n'; import { JitsiModal } from '../../../base/modal'; import { connect } from '../../../base/redux'; import { PollsPane } from '../../../polls/components'; import { closeChat } from '../../actions.any'; import { BUTTON_MODES, CHAT_VIEW_MODAL_ID } from '../../constants'; import AbstractChat, { _mapStateToProps, type Props } from '../AbstractChat'; import ChatInputBar from './ChatInputBar'; import MessageContainer from './MessageContainer'; 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 { /** * Creates a new instance. * * @inheritdoc */ constructor(props: Props) { super(props); this._onClose = this._onClose.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc */ render() { return ( {this.props._isPollsEnabled && } {this.props._isPollsTabFocused ? : ( <> )} ); } _onSendMessage: (string) => void; _onClose: () => boolean _onTogglePollsTab: () => void; _onToggleChatTab: () => void; /** * Closes the modal. * * @returns {boolean} */ _onClose() { this.props.dispatch(closeChat()); return true; } } export default translate(connect(_mapStateToProps)(Chat));