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.

VideoMenu.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // @flow
  2. import React from 'react';
  3. /**
  4. * The type of the React {@code Component} props of {@link VideoMenu}.
  5. */
  6. type Props = {
  7. /**
  8. * The components to place as the body of the {@code VideoMenu}.
  9. */
  10. children: React$Node,
  11. /**
  12. * The id attribute to be added to the component's DOM for retrieval when
  13. * querying the DOM. Not used directly by the component.
  14. */
  15. id: string
  16. };
  17. /**
  18. * Click handler.
  19. *
  20. * @param {SyntheticEvent} event - The click event.
  21. * @returns {void}
  22. */
  23. function onClick(event) {
  24. // If the event is propagated to the thumbnail container the participant will be pinned. That's why the propagation
  25. // needs to be stopped.
  26. event.stopPropagation();
  27. }
  28. /**
  29. * React {@code Component} responsible for displaying other components as a menu
  30. * for manipulating participant state.
  31. *
  32. * @param {Props} props - The component's props.
  33. * @returns {Component}
  34. */
  35. export default function VideoMenu(props: Props) {
  36. return (
  37. <ul
  38. className = 'popupmenu'
  39. id = { props.id }
  40. onClick = { onClick }>
  41. { props.children }
  42. </ul>
  43. );
  44. }