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.

OverflowMenuLiveStreamingItem.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../../base/i18n';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link OverflowMenuLiveStreamingItem}.
  7. */
  8. type Props = {
  9. /**
  10. * The callback to invoke when {@code OverflowMenuLiveStreamingItem} is
  11. * clicked.
  12. */
  13. onClick: Function,
  14. /**
  15. * The current live streaming session, if any.
  16. */
  17. session: ?Object,
  18. /**
  19. * Invoked to obtain translated strings.
  20. */
  21. t: Function
  22. };
  23. /**
  24. * React {@code Component} for starting or stopping a live streaming of the
  25. * current conference and displaying the current state of live streaming.
  26. *
  27. * @extends Component
  28. */
  29. class OverflowMenuLiveStreamingItem extends Component<Props> {
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. const { onClick, session, t } = this.props;
  38. const translationKey = session
  39. ? 'dialog.stopLiveStreaming'
  40. : 'dialog.startLiveStreaming';
  41. return (
  42. <li
  43. aria-label = 'Live stream'
  44. className = 'overflow-menu-item'
  45. onClick = { onClick }>
  46. <span className = 'overflow-menu-item-icon'>
  47. <i className = 'icon-public' />
  48. </span>
  49. <span className = 'profile-text'>
  50. { t(translationKey) }
  51. </span>
  52. <span className = 'beta-tag'>
  53. { t('recording.beta') }
  54. </span>
  55. </li>
  56. );
  57. }
  58. }
  59. export default translate(OverflowMenuLiveStreamingItem);