您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MeetingParticipantItem.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useSelector, useDispatch } from 'react-redux';
  4. import {
  5. getIsParticipantAudioMuted,
  6. getIsParticipantVideoMuted
  7. } from '../../../base/tracks';
  8. import { showContextMenuDetails } from '../../actions.native';
  9. import { MediaState } from '../../constants';
  10. import ParticipantItem from './ParticipantItem';
  11. type Props = {
  12. /**
  13. * Participant reference
  14. */
  15. participant: Object
  16. };
  17. export const MeetingParticipantItem = ({ participant: p }: Props) => {
  18. const dispatch = useDispatch();
  19. const isAudioMuted = useSelector(getIsParticipantAudioMuted(p));
  20. const isVideoMuted = useSelector(getIsParticipantVideoMuted(p));
  21. const openContextMenuDetails = useCallback(() => dispatch(showContextMenuDetails(p), [ dispatch ]));
  22. return (
  23. <ParticipantItem
  24. audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
  25. isKnockingParticipant = { false }
  26. name = { p.name }
  27. onPress = { openContextMenuDetails }
  28. participant = { p }
  29. videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
  30. );
  31. };