Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ShareRoomButton.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // @flow
  2. import { connect } from 'react-redux';
  3. import { translate } from '../../../../base/i18n';
  4. import { beginShareRoom } from '../../../../share-room';
  5. import AbstractButton from '../AbstractButton';
  6. import type { Props as AbstractButtonProps } from '../AbstractButton';
  7. type Props = AbstractButtonProps & {
  8. /**
  9. * The redux {@code dispatch} function.
  10. */
  11. dispatch: Function
  12. }
  13. /**
  14. * An implementation of a button for sharing a room using the native OS sharing
  15. * capabilities.
  16. */
  17. class ShareRoomButton extends AbstractButton<Props, *> {
  18. accessibilityLabel = 'Share room';
  19. iconName = 'icon-link';
  20. label = 'toolbar.shareRoom';
  21. /**
  22. * Handles clicking / pressing the button, and opens the appropriate dialog.
  23. *
  24. * @private
  25. * @returns {void}
  26. */
  27. _handleClick() {
  28. this.props.dispatch(beginShareRoom());
  29. }
  30. /**
  31. * Indicates whether this button is disabled or not.
  32. *
  33. * @override
  34. * @private
  35. * @returns {boolean}
  36. */
  37. _isDisabled() {
  38. return false;
  39. }
  40. }
  41. export default translate(connect()(ShareRoomButton));