jiti-meet/react/features/base/premeeting/components/web/CopyMeetingUrl.js

68 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-04-16 10:47:10 +00:00
// @flow
import React, { Component } from 'react';
2020-05-20 10:57:03 +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.
*/
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.
*/
class CopyMeetingUrl extends Component<Props> {
2020-04-16 10:47:10 +00:00
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return (
<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) {
const { enableAutomaticUrlCopy } = state['features/base/config'];
const { customizationReady } = state['features/dynamic-branding'];
2020-04-16 10:47:10 +00:00
return {
url: customizationReady ? getCurrentConferenceUrl(state) : '',
_enableAutomaticUrlCopy: enableAutomaticUrlCopy || false
2020-04-16 10:47:10 +00:00
};
}
export default connect(mapStateToProps)(translate(CopyMeetingUrl));