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.

MeetingParticipantItem.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. name = { p.name }
  26. onPress = { openContextMenuDetails }
  27. participant = { p }
  28. videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
  29. );
  30. };