snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
50
react/features/toolbox/components/HangupButton.ts
Normal file
50
react/features/toolbox/components/HangupButton.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { once } from 'lodash-es';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { createToolbarEvent } from '../../analytics/AnalyticsEvents';
|
||||
import { sendAnalytics } from '../../analytics/functions';
|
||||
import { leaveConference } from '../../base/conference/actions';
|
||||
import { translate } from '../../base/i18n/functions';
|
||||
import { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
|
||||
import AbstractHangupButton from '../../base/toolbox/components/AbstractHangupButton';
|
||||
|
||||
/**
|
||||
* Component that renders a toolbar button for leaving the current conference.
|
||||
*
|
||||
* @augments AbstractHangupButton
|
||||
*/
|
||||
class HangupButton extends AbstractHangupButton<AbstractButtonProps> {
|
||||
_hangup: Function;
|
||||
|
||||
override accessibilityLabel = 'toolbar.accessibilityLabel.hangup';
|
||||
override label = 'toolbar.hangup';
|
||||
override tooltip = 'toolbar.hangup';
|
||||
|
||||
/**
|
||||
* Initializes a new HangupButton instance.
|
||||
*
|
||||
* @param {Props} props - The read-only properties with which the new
|
||||
* instance is to be initialized.
|
||||
*/
|
||||
constructor(props: AbstractButtonProps) {
|
||||
super(props);
|
||||
|
||||
this._hangup = once(() => {
|
||||
sendAnalytics(createToolbarEvent('hangup'));
|
||||
this.props.dispatch(leaveConference());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to perform the actual hangup action.
|
||||
*
|
||||
* @override
|
||||
* @protected
|
||||
* @returns {void}
|
||||
*/
|
||||
override _doHangup() {
|
||||
this._hangup();
|
||||
}
|
||||
}
|
||||
|
||||
export default translate(connect()(HangupButton));
|
||||
Reference in New Issue
Block a user