Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ConnectionStatusButton.tsx 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React, { useCallback } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useDispatch } from 'react-redux';
  4. import { IconInfoCircle } from '../../../base/icons/svg';
  5. import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  6. import { NOTIFY_CLICK_MODE } from '../../../toolbox/constants';
  7. import { renderConnectionStatus } from '../../actions.web';
  8. import { IButtonProps } from '../../types';
  9. /**
  10. * Implements a React {@link Component} which displays a button that shows
  11. * the connection status for the given participant.
  12. *
  13. * @returns {JSX.Element}
  14. */
  15. const ConnectionStatusButton = ({
  16. notifyClick,
  17. notifyMode
  18. }: IButtonProps): JSX.Element => {
  19. const { t } = useTranslation();
  20. const dispatch = useDispatch();
  21. const handleClick = useCallback(e => {
  22. e.stopPropagation();
  23. notifyClick?.();
  24. if (notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY) {
  25. return;
  26. }
  27. dispatch(renderConnectionStatus(true));
  28. }, [ dispatch, notifyClick, notifyMode ]);
  29. return (
  30. <ContextMenuItem
  31. accessibilityLabel = { t('videothumbnail.connectionInfo') }
  32. icon = { IconInfoCircle }
  33. onClick = { handleClick }
  34. text = { t('videothumbnail.connectionInfo') } />
  35. );
  36. };
  37. export default ConnectionStatusButton;