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

OverflowMenu.js 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { hideDialog, BottomSheet } from '../../../base/dialog';
  5. import { AudioRouteButton } from '../../../mobile/audio-mode';
  6. import { PictureInPictureButton } from '../../../mobile/picture-in-picture';
  7. import { RoomLockButton } from '../../../room-lock';
  8. import AudioOnlyButton from './AudioOnlyButton';
  9. import ToggleCameraButton from './ToggleCameraButton';
  10. import { overflowMenuItemStyles } from './styles';
  11. type Props = {
  12. /**
  13. * Used for hiding the dialog when the selection was completed.
  14. */
  15. dispatch: Function,
  16. };
  17. /**
  18. * The exported React {@code Component}. We need a reference to the wrapped
  19. * component in order to be able to hide it using the dialog hiding logic.
  20. */
  21. // eslint-disable-next-line prefer-const
  22. let OverflowMenu_;
  23. /**
  24. * Implements a React {@code Component} with some extra actions in addition to
  25. * those in the toolbar.
  26. */
  27. class OverflowMenu extends Component<Props> {
  28. /**
  29. * Initializes a new {@code OverflowMenu} instance.
  30. *
  31. * @inheritdoc
  32. */
  33. constructor(props: Props) {
  34. super(props);
  35. this._onCancel = this._onCancel.bind(this);
  36. }
  37. /**
  38. * Implements React's {@link Component#render()}.
  39. *
  40. * @inheritdoc
  41. * @returns {ReactElement}
  42. */
  43. render() {
  44. return (
  45. <BottomSheet onCancel = { this._onCancel }>
  46. <AudioRouteButton
  47. showLabel = { true }
  48. styles = { overflowMenuItemStyles } />
  49. <ToggleCameraButton
  50. showLabel = { true }
  51. styles = { overflowMenuItemStyles } />
  52. <AudioOnlyButton
  53. showLabel = { true }
  54. styles = { overflowMenuItemStyles } />
  55. <RoomLockButton
  56. showLabel = { true }
  57. styles = { overflowMenuItemStyles } />
  58. <PictureInPictureButton
  59. showLabel = { true }
  60. styles = { overflowMenuItemStyles } />
  61. </BottomSheet>
  62. );
  63. }
  64. _onCancel: () => void;
  65. /**
  66. * Hides the dialog.
  67. *
  68. * @private
  69. * @returns {void}
  70. */
  71. _onCancel() {
  72. this.props.dispatch(hideDialog(OverflowMenu_));
  73. }
  74. }
  75. OverflowMenu_ = connect()(OverflowMenu);
  76. export default OverflowMenu_;