2020-04-16 10:47:10 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2021-06-10 12:48:44 +00:00
|
|
|
import CopyMeetingLinkSection
|
|
|
|
from '../../../../invite/components/add-people-dialog/web/CopyMeetingLinkSection';
|
2020-05-20 08:25:31 +00:00
|
|
|
import { getCurrentConferenceUrl } from '../../../connection';
|
|
|
|
import { translate } from '../../../i18n';
|
|
|
|
import { connect } from '../../../redux';
|
2020-04-16 10:47:10 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The meeting url.
|
|
|
|
*/
|
|
|
|
url: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for translation.
|
|
|
|
*/
|
2020-08-30 14:36:52 +00:00
|
|
|
t: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to determine if invitation link should be automatically copied
|
|
|
|
* after creating a meeting.
|
|
|
|
*/
|
|
|
|
_enableAutomaticUrlCopy: boolean,
|
2020-04-16 10:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component used to copy meeting url on prejoin page.
|
|
|
|
*/
|
2021-06-10 12:48:44 +00:00
|
|
|
class CopyMeetingUrl extends Component<Props> {
|
2020-08-30 14:36:52 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2021-06-10 12:48:44 +00:00
|
|
|
<div className = 'copy-meeting'>
|
|
|
|
<CopyMeetingLinkSection url = { this.props.url } />
|
2020-05-20 08:25:31 +00:00
|
|
|
</div>
|
|
|
|
);
|
2020-04-16 10:47:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the React {@code Component} props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
|
|
|
function mapStateToProps(state) {
|
2020-08-30 14:36:52 +00:00
|
|
|
const { enableAutomaticUrlCopy } = state['features/base/config'];
|
2020-10-29 12:20:46 +00:00
|
|
|
const { customizationReady } = state['features/dynamic-branding'];
|
2020-08-30 14:36:52 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
return {
|
2020-10-29 12:20:46 +00:00
|
|
|
url: customizationReady ? getCurrentConferenceUrl(state) : '',
|
2020-08-30 14:36:52 +00:00
|
|
|
_enableAutomaticUrlCopy: enableAutomaticUrlCopy || false
|
2020-04-16 10:47:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(translate(CopyMeetingUrl));
|