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

VerifyParticipantButton.tsx 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React, { useCallback } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { connect } from 'react-redux';
  4. import { IReduxState, IStore } from '../../../app/types';
  5. import { IconCheck } from '../../../base/icons/svg';
  6. import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  7. import { startVerification } from '../../../e2ee/actions';
  8. /**
  9. * The type of the React {@code Component} props of
  10. * {@link VerifyParticipantButton}.
  11. */
  12. interface IProps {
  13. /**
  14. * The redux {@code dispatch} function.
  15. */
  16. dispatch: IStore['dispatch'];
  17. /**
  18. * The ID of the participant that this button is supposed to verified.
  19. */
  20. participantID: string;
  21. }
  22. const VerifyParticipantButton = ({
  23. dispatch,
  24. participantID
  25. }: IProps) => {
  26. const { t } = useTranslation();
  27. const _handleClick = useCallback(() => {
  28. dispatch(startVerification(participantID));
  29. }, [ participantID ]);
  30. return (
  31. <ContextMenuItem
  32. accessibilityLabel = { t('videothumbnail.verify') }
  33. className = 'verifylink'
  34. icon = { IconCheck }
  35. id = { `verifylink_${participantID}` }
  36. // eslint-disable-next-line react/jsx-handler-names
  37. onClick = { _handleClick }
  38. text = { t('videothumbnail.verify') } />
  39. );
  40. };
  41. /**
  42. * Maps (parts of) the Redux state to the associated {@code RemoteVideoMenuTriggerButton}'s props.
  43. *
  44. * @param {Object} state - The Redux state.
  45. * @param {Object} ownProps - The own props of the component.
  46. * @private
  47. * @returns {IProps}
  48. */
  49. function _mapStateToProps(state: IReduxState, ownProps: Partial<IProps>) {
  50. const { participantID } = ownProps;
  51. return {
  52. _participantID: participantID
  53. };
  54. }
  55. export default connect(_mapStateToProps)(VerifyParticipantButton);