您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

InviteButton.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { getFeatureFlag, INVITE_ENABLED } from '../../../../base/flags';
  4. import { translate } from '../../../../base/i18n';
  5. import { IconAddPeople } from '../../../../base/icons';
  6. import { connect } from '../../../../base/redux';
  7. import { AbstractButton } from '../../../../base/toolbox';
  8. import type { AbstractButtonProps } from '../../../../base/toolbox';
  9. import { doInvitePeople } from '../../../actions.native';
  10. type Props = AbstractButtonProps & {
  11. /**
  12. * The Redux dispatch function.
  13. */
  14. dispatch: Dispatch<any>
  15. };
  16. /**
  17. * Implements an {@link AbstractButton} to enter add/invite people to the
  18. * current call/conference/meeting.
  19. */
  20. class InviteButton extends AbstractButton<Props, *> {
  21. accessibilityLabel = 'toolbar.accessibilityLabel.shareRoom';
  22. icon = IconAddPeople;
  23. label = 'toolbar.shareRoom';
  24. /**
  25. * Handles clicking / pressing the button, and opens the appropriate dialog.
  26. *
  27. * @private
  28. * @returns {void}
  29. */
  30. _handleClick() {
  31. this.props.dispatch(doInvitePeople());
  32. }
  33. }
  34. /**
  35. * Maps part of the Redux state to the props of this component.
  36. *
  37. * @param {Object} state - The Redux state.
  38. * @param {Props} ownProps - The own props of the component.
  39. * @returns {Props}
  40. */
  41. function _mapStateToProps(state, ownProps: Props) {
  42. const { disableInviteFunctions } = state['features/base/config'];
  43. const flag = getFeatureFlag(state, INVITE_ENABLED, true);
  44. return {
  45. visible: flag && !disableInviteFunctions && ownProps.visible
  46. };
  47. }
  48. export default translate(connect(_mapStateToProps)(InviteButton));