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

HangupButton.tsx 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { Component } from 'react';
  2. // We need to reference these files directly to avoid loading things that are not available
  3. // in this environment (e.g. JitsiMeetJS or interfaceConfig)
  4. import { IconHangup } from '../base/icons/svg';
  5. import { IProps } from '../base/toolbox/components/AbstractButton';
  6. import ToolbarButton from './ToolbarButton';
  7. const { api } = window.alwaysOnTop;
  8. type Props = Partial<IProps>;
  9. /**
  10. * Stateless hangup button for the Always-on-Top windows.
  11. */
  12. export default class HangupButton extends Component<Props> {
  13. accessibilityLabel = 'Hangup';
  14. icon = IconHangup;
  15. /**
  16. * Initializes a new {@code HangupButton} instance.
  17. *
  18. * @param {IProps} props - The React {@code Component} props to initialize
  19. * the new {@code HangupButton} instance with.
  20. */
  21. constructor(props: Props) {
  22. super(props);
  23. // Bind event handlers so they are only bound once per instance.
  24. this._onClick = this._onClick.bind(this);
  25. }
  26. /**
  27. * Handles clicking / pressing the button, and disconnects the conference.
  28. *
  29. * @protected
  30. * @returns {void}
  31. */
  32. _onClick() {
  33. api.executeCommand('hangup');
  34. }
  35. /**
  36. * Implements React's {@link Component#render()}.
  37. *
  38. * @inheritdoc
  39. * @returns {ReactElement}
  40. */
  41. render() {
  42. return (<ToolbarButton
  43. accessibilityLabel = { this.accessibilityLabel }
  44. customClass = 'hangup-button'
  45. icon = { this.icon }
  46. onClick = { this._onClick } />);
  47. }
  48. }