| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 | 
							- import React, { Component } from 'react';
 - import { connect } from 'react-redux';
 - 
 - import { Dialog } from '../../base/dialog';
 - import { translate } from '../../base/i18n';
 - import JitsiMeetJS from '../../base/lib-jitsi-meet';
 - import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
 - 
 - import DialInNumbersForm from './DialInNumbersForm';
 - import PasswordContainer from './PasswordContainer';
 - import ShareLinkForm from './ShareLinkForm';
 - 
 - /**
 -  * A React {@code Component} for displaying other components responsible for
 -  * copying the current conference url and for setting or removing a conference
 -  * password.
 -  */
 - class InviteDialog extends Component {
 -     /**
 -      * {@code InviteDialog} component's property types.
 -      *
 -      * @static
 -      */
 -     static propTypes = {
 -         /**
 -          * The redux store representation of the JitsiConference.
 -          *
 -          */
 -         _conference: React.PropTypes.object,
 - 
 -         /**
 -          * Whether or not the current user is a conference moderator.
 -          */
 -         _isModerator: React.PropTypes.bool,
 - 
 -         /**
 -          * The url for the JitsiConference.
 -          */
 -         conferenceUrl: React.PropTypes.string,
 - 
 -         /**
 -          * Invoked to obtain translated strings.
 -          */
 -         t: React.PropTypes.func
 -     };
 - 
 -     /**
 -      * Reports an analytics event for the invite modal being closed.
 -      *
 -      * @inheritdoc
 -      */
 -     componentWillUnmount() {
 -         JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
 -     }
 - 
 -     /**
 -      * Implements React's {@link Component#render()}.
 -      *
 -      * @inheritdoc
 -      * @returns {ReactElement}
 -      */
 -     render() {
 -         const { _conference, conferenceUrl } = this.props;
 -         const titleString
 -             = this.props.t(
 -                 'invite.inviteTo',
 -                 { conferenceName: _conference.room });
 - 
 -         return (
 -             <Dialog
 -                 cancelDisabled = { true }
 -                 okTitleKey = 'dialog.done'
 -                 titleString = { titleString }>
 -                 <div className = 'invite-dialog'>
 -                     <ShareLinkForm toCopy = { conferenceUrl } />
 -                     <DialInNumbersForm conferenceUrl = { conferenceUrl } />
 -                     <PasswordContainer
 -                         conference = { _conference.conference }
 -                         locked = { _conference.locked }
 -                         password = { _conference.password }
 -                         showPasswordEdit = { this.props._isModerator } />
 -                 </div>
 -             </Dialog>
 -         );
 -     }
 - }
 - 
 - /**
 -  * Maps (parts of) the Redux state to the associated {@code InviteDialog}'s
 -  * props.
 -  *
 -  * @param {Object} state - The Redux state.
 -  * @private
 -  * @returns {{
 -  *     _conference: Object,
 -  *     _isModerator: boolean
 -  * }}
 -  */
 - function _mapStateToProps(state) {
 -     const { role }
 -         = getLocalParticipant(state['features/base/participants']);
 - 
 -     return {
 -         _conference: state['features/base/conference'],
 -         _isModerator: role === PARTICIPANT_ROLE.MODERATOR
 -     };
 - }
 - 
 - export default translate(connect(_mapStateToProps)(InviteDialog));
 
 
  |