2021-07-08 13:42:07 +00:00
|
|
|
// @flow
|
|
|
|
|
2021-10-22 13:23:52 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconUsers } from '../../../base/icons';
|
2021-10-22 13:23:52 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
|
2021-07-08 13:42:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link ParticipantsPaneButton}.
|
|
|
|
*/
|
|
|
|
type Props = AbstractButtonProps & {
|
|
|
|
|
2021-08-18 13:44:11 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the participants pane is open.
|
|
|
|
*/
|
|
|
|
_isOpen: boolean,
|
2021-07-08 13:42:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of a button for accessing participants pane.
|
|
|
|
*/
|
|
|
|
class ParticipantsPaneButton extends AbstractButton<Props, *> {
|
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.participants';
|
2022-11-08 10:24:32 +00:00
|
|
|
icon = IconUsers;
|
2021-07-08 13:42:07 +00:00
|
|
|
label = 'toolbar.participants';
|
|
|
|
tooltip = 'toolbar.participants';
|
|
|
|
|
2021-08-18 13:44:11 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
};
|
2021-07-08 13:42:07 +00:00
|
|
|
}
|
|
|
|
|
2021-08-18 13:44:11 +00:00
|
|
|
export default translate(connect(mapStateToProps)(ParticipantsPaneButton));
|