選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

RemoteVideoMenuButton.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import React, { Component } from 'react';
  2. /**
  3. * React {@code Component} for displaying an action in {@code RemoteVideoMenu}.
  4. *
  5. * @extends {Component}
  6. */
  7. export default class RemoteVideoMenuButton extends Component {
  8. /**
  9. * {@code RemoteVideoMenuButton}'s property types.
  10. *
  11. * @static
  12. */
  13. static propTypes = {
  14. /**
  15. * Text to display within the component that describes the onClick
  16. * action.
  17. */
  18. buttonText: React.PropTypes.string,
  19. /**
  20. * Additional CSS classes to add to the component.
  21. */
  22. displayClass: React.PropTypes.string,
  23. /**
  24. * The CSS classes for the icon that will display within the component.
  25. */
  26. iconClass: React.PropTypes.string,
  27. /**
  28. * The id attribute to be added to the component's DOM for retrieval
  29. * when querying the DOM. Not used directly by the component.
  30. */
  31. id: React.PropTypes.string,
  32. /**
  33. * Callback to invoke when the component is clicked.
  34. */
  35. onClick: React.PropTypes.func
  36. };
  37. /**
  38. * Implements React's {@link Component#render()}.
  39. *
  40. * @inheritdoc
  41. * @returns {ReactElement}
  42. */
  43. render() {
  44. const {
  45. buttonText,
  46. displayClass,
  47. iconClass,
  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. <i className = { iconClass } />
  60. </span>
  61. <span className = 'popupmenu__text'>
  62. { buttonText }
  63. </span>
  64. </a>
  65. </li>
  66. );
  67. }
  68. }