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

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