2023-03-21 09:47:52 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
2023-03-30 11:27:53 +03:00
|
|
|
import { createToolbarEvent } from '../../analytics/AnalyticsEvents';
|
|
|
|
|
import { sendAnalytics } from '../../analytics/functions';
|
2023-06-29 14:59:12 +03:00
|
|
|
import { IReduxState } from '../../app/types';
|
2023-03-30 11:27:53 +03:00
|
|
|
import { openDialog } from '../../base/dialog/actions';
|
2023-06-29 14:59:12 +03:00
|
|
|
import { isMobileBrowser } from '../../base/environment/utils';
|
2023-03-30 11:27:53 +03:00
|
|
|
import { translate } from '../../base/i18n/functions';
|
|
|
|
|
import { IconCode } from '../../base/icons/svg';
|
|
|
|
|
import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
|
2023-06-29 14:59:12 +03:00
|
|
|
import { isVpaasMeeting } from '../../jaas/functions';
|
2021-07-08 16:42:07 +03:00
|
|
|
|
|
|
|
|
import EmbedMeetingDialog from './EmbedMeetingDialog';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implementation of a button for opening embed meeting dialog.
|
|
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
class EmbedMeetingButton extends AbstractButton<AbstractButtonProps> {
|
2021-07-08 16:42:07 +03:00
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.embedMeeting';
|
2022-11-08 12:24:32 +02:00
|
|
|
icon = IconCode;
|
2021-07-08 16:42:07 +03:00
|
|
|
label = 'toolbar.embedMeeting';
|
|
|
|
|
tooltip = 'toolbar.embedMeeting';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handles clicking / pressing the button, and opens the appropriate dialog.
|
|
|
|
|
*
|
|
|
|
|
* @protected
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
_handleClick() {
|
2022-01-04 13:21:00 +02:00
|
|
|
const { dispatch } = this.props;
|
2021-07-08 16:42:07 +03:00
|
|
|
|
|
|
|
|
sendAnalytics(createToolbarEvent('embed.meeting'));
|
|
|
|
|
dispatch(openDialog(EmbedMeetingDialog));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-29 14:59:12 +03:00
|
|
|
/**
|
|
|
|
|
* Function that maps parts of Redux state tree into component props.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} state - Redux state.
|
|
|
|
|
* @returns {Object}
|
|
|
|
|
*/
|
|
|
|
|
const mapStateToProps = (state: IReduxState) => {
|
|
|
|
|
return {
|
|
|
|
|
visible: !isVpaasMeeting(state) && !isMobileBrowser()
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default translate(connect(mapStateToProps)(EmbedMeetingButton));
|