import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { getInviteURL } from '../../base/connection'; import { openDialog } from '../../base/dialog'; import { translate } from '../../base/i18n'; import AddPeopleDialog from './AddPeopleDialog'; const logger = require('jitsi-meet-logger').getLogger(__filename); declare var interfaceConfig: Object; /** * A React Component with the contents for a dialog that shows information about * the current conference and provides ways to invite other participants. * * @extends Component */ class InfoDialog extends Component { /** * {@code InfoDialog} component's property types. * * @static */ static propTypes = { /** * The current url of the conference to be copied onto the clipboard. */ _inviteURL: PropTypes.string, /** * Whether or not the link to open the {@code AddPeopleDialog} should be * displayed. */ _showAddPeople: PropTypes.bool, /** * Invoked to open a dialog for adding participants to the conference. */ dispatch: PropTypes.func, /** * Callback invoked when the dialog should be closed. */ onClose: PropTypes.func, /** * Callback invoked when a mouse-related event has been detected. */ onMouseOver: PropTypes.func, /** * Invoked to obtain translated strings. */ t: PropTypes.func }; /** * Initializes new {@code InfoDialog} instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); /** * The internal reference to the DOM/HTML element backing the React * {@code Component} input. It is necessary for the implementation * of copying to the clipboard. * * @private * @type {HTMLInputElement} */ this._copyElement = null; // Bind event handlers so they are only bound once for every instance. this._onCopyInviteURL = this._onCopyInviteURL.bind(this); this._onOpenInviteDialog = this._onOpenInviteDialog.bind(this); this._setCopyElement = this._setCopyElement.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { return (