mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-03-26 05:20:20 +00:00
Adds dedicated buttons for polls and file sharing in the toolbar overflow menu, following the pattern of the CC button. Both buttons open the chat panel with their respective tab selected when clicked.
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { connect } from 'react-redux';
|
|
|
|
import { IReduxState } from '../../../app/types';
|
|
import { translate } from '../../../base/i18n/functions';
|
|
import { IconShareDoc } from '../../../base/icons/svg';
|
|
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
|
|
import { openFileSharingPanel } from '../../../chat/actions.any';
|
|
import { isFileSharingEnabled } from '../../functions.any';
|
|
|
|
/**
|
|
* Component that renders a button to open the file sharing panel.
|
|
*
|
|
* @augments AbstractButton
|
|
*/
|
|
class FileSharingButton extends AbstractButton<AbstractButtonProps> {
|
|
override icon = IconShareDoc;
|
|
override label = 'toolbar.fileSharing';
|
|
override tooltip = 'toolbar.fileSharing';
|
|
|
|
/**
|
|
* Handles clicking the button to open the file sharing panel.
|
|
*
|
|
* @private
|
|
* @returns {void}
|
|
*/
|
|
override _handleClick() {
|
|
const { dispatch } = this.props;
|
|
|
|
dispatch(openFileSharingPanel());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Maps part of the Redux state to the props of this component.
|
|
*
|
|
* @param {IReduxState} state - The Redux state.
|
|
* @returns {Object} - Mapped props.
|
|
*/
|
|
function mapStateToProps(state: IReduxState) {
|
|
return {
|
|
visible: isFileSharingEnabled(state)
|
|
};
|
|
}
|
|
|
|
export default translate(connect(mapStateToProps)(FileSharingButton));
|