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.

ConnectionStatusButton.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { IconInfoCircle } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  7. import { renderConnectionStatus } from '../../actions.web';
  8. type Props = {
  9. /**
  10. * The Redux dispatch function.
  11. */
  12. dispatch: Function,
  13. /**
  14. * The ID of the participant for which to show connection stats.
  15. */
  16. participantId: string,
  17. /**
  18. * The function to be used to translate i18n labels.
  19. */
  20. t: Function
  21. };
  22. const ConnectionStatusButton = ({
  23. dispatch,
  24. t
  25. }: Props) => {
  26. const onClick = useCallback(e => {
  27. e.stopPropagation();
  28. dispatch(renderConnectionStatus(true));
  29. }, [ dispatch ]);
  30. return (
  31. <ContextMenuItem
  32. accessibilityLabel = { t('videothumbnail.connectionInfo') }
  33. icon = { IconInfoCircle }
  34. onClick = { onClick }
  35. text = { t('videothumbnail.connectionInfo') } />
  36. );
  37. };
  38. export default translate(connect()(ConnectionStatusButton));