You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RemoteVideoMenuButton.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { Icon } from '../../../base/icons';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link RemoteVideoMenuButton}.
  7. */
  8. type Props = {
  9. /**
  10. * Text to display within the component that describes the onClick action.
  11. */
  12. buttonText: string,
  13. /**
  14. * Additional CSS classes to add to the component.
  15. */
  16. displayClass?: string,
  17. /**
  18. * The icon that will display within the component.
  19. */
  20. icon: Object,
  21. /**
  22. * The id attribute to be added to the component's DOM for retrieval when
  23. * querying the DOM. Not used directly by the component.
  24. */
  25. id: string,
  26. /**
  27. * Callback to invoke when the component is clicked.
  28. */
  29. onClick: Function,
  30. };
  31. /**
  32. * React {@code Component} for displaying an action in {@code RemoteVideoMenu}.
  33. *
  34. * @extends {Component}
  35. */
  36. export default class RemoteVideoMenuButton extends Component<Props> {
  37. /**
  38. * Implements React's {@link Component#render()}.
  39. *
  40. * @inheritdoc
  41. * @returns {ReactElement}
  42. */
  43. render() {
  44. const {
  45. buttonText,
  46. displayClass,
  47. icon,
  48. id,
  49. onClick
  50. } = this.props;
  51. const linkClassName = `popupmenu__link ${displayClass || ''}`;
  52. return (
  53. <li className = 'popupmenu__item'>
  54. <a
  55. className = { linkClassName }
  56. id = { id }
  57. onClick = { onClick }>
  58. <span className = 'popupmenu__icon'>
  59. <Icon src = { icon } />
  60. </span>
  61. <span className = 'popupmenu__text'>
  62. { buttonText }
  63. </span>
  64. </a>
  65. </li>
  66. );
  67. }
  68. }