mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-19 23:27:47 +00:00
Created Reusable components for: - ListItem - used by participants list and lobby participants list - ContextMenu - used by participant context menu and advanced moderation context menu - Quick action button - used by quick action buttons on participant list items Moved participants custom theme to base/components/themes Created reusable button component for all participants pane buttons (Invite, Mute All, More) Moved web components to web folder Moved all styles from Styled Components to JSS Fixed accessibility labels for some buttons Removed unused code Updated all styles to use theme tokens
71 lines
1.6 KiB
JavaScript
71 lines
1.6 KiB
JavaScript
// @flow
|
|
|
|
import { translate } from '../../../base/i18n';
|
|
import { IconParticipants } from '../../../base/icons';
|
|
import { connect } from '../../../base/redux';
|
|
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
|
|
|
|
/**
|
|
* The type of the React {@code Component} props of {@link ParticipantsPaneButton}.
|
|
*/
|
|
type Props = AbstractButtonProps & {
|
|
|
|
/**
|
|
* Whether or not the participants pane is open.
|
|
*/
|
|
_isOpen: boolean,
|
|
};
|
|
|
|
/**
|
|
* Implementation of a button for accessing participants pane.
|
|
*/
|
|
class ParticipantsPaneButton extends AbstractButton<Props, *> {
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.participants';
|
|
icon = IconParticipants;
|
|
label = 'toolbar.participants';
|
|
tooltip = 'toolbar.participants';
|
|
|
|
/**
|
|
* Handles clicking / pressing the button, and opens the appropriate dialog.
|
|
*
|
|
* @protected
|
|
* @returns {void}
|
|
*/
|
|
_handleClick() {
|
|
const { handleClick } = this.props;
|
|
|
|
if (handleClick) {
|
|
handleClick();
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Indicates whether this button is in toggled state or not.
|
|
*
|
|
* @override
|
|
* @protected
|
|
* @returns {boolean}
|
|
*/
|
|
_isToggled() {
|
|
return this.props._isOpen;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Maps part of the Redux state to the props of this component.
|
|
*
|
|
* @param {Object} state - The Redux state.
|
|
* @returns {Props}
|
|
*/
|
|
function mapStateToProps(state) {
|
|
const { isOpen } = state['features/participants-pane'];
|
|
|
|
return {
|
|
_isOpen: isOpen
|
|
};
|
|
}
|
|
|
|
export default translate(connect(mapStateToProps)(ParticipantsPaneButton));
|