Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ThumbnailBottomIndicators.tsx 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* eslint-disable lines-around-comment */
  2. import React from 'react';
  3. import { useSelector } from 'react-redux';
  4. import { makeStyles } from 'tss-react/mui';
  5. import { IState } from '../../../app/types';
  6. import {
  7. getMultipleVideoSupportFeatureFlag,
  8. isDisplayNameVisible,
  9. isNameReadOnly
  10. // @ts-ignore
  11. } from '../../../base/config/functions.any';
  12. import { isScreenShareParticipantById } from '../../../base/participants/functions';
  13. // @ts-ignore
  14. import DisplayName from '../../../display-name/components/web/DisplayName';
  15. import { THUMBNAIL_TYPE } from '../../constants';
  16. // @ts-ignore
  17. import StatusIndicators from './StatusIndicators';
  18. declare let interfaceConfig: any;
  19. type Props = {
  20. /**
  21. * Class name for indicators container.
  22. */
  23. className: string;
  24. /**
  25. * Whether or not the indicators are for the local participant.
  26. */
  27. local: boolean;
  28. /**
  29. * Id of the participant for which the component is displayed.
  30. */
  31. participantId: string;
  32. /**
  33. * Whether or not to show the status indicators.
  34. */
  35. showStatusIndicators?: boolean;
  36. /**
  37. * The type of thumbnail.
  38. */
  39. thumbnailType: string;
  40. };
  41. const useStyles = makeStyles()(() => {
  42. return {
  43. nameContainer: {
  44. display: 'flex',
  45. overflow: 'hidden',
  46. padding: '2px 0',
  47. '&>div': {
  48. display: 'flex',
  49. overflow: 'hidden'
  50. },
  51. '&:first-child': {
  52. marginLeft: '6px'
  53. }
  54. }
  55. };
  56. });
  57. const ThumbnailBottomIndicators = ({
  58. className,
  59. local,
  60. participantId,
  61. showStatusIndicators = true,
  62. thumbnailType
  63. }: Props) => {
  64. const { classes: styles } = useStyles();
  65. const _allowEditing = !useSelector(isNameReadOnly);
  66. const _defaultLocalDisplayName = interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME;
  67. const _isMultiStreamEnabled = useSelector(getMultipleVideoSupportFeatureFlag);
  68. const _showDisplayName = useSelector(isDisplayNameVisible);
  69. const isVirtualScreenshareParticipant = useSelector(
  70. (state: IState) => isScreenShareParticipantById(state, participantId)
  71. );
  72. return (<div className = { className }>
  73. {
  74. showStatusIndicators && <StatusIndicators
  75. audio = { !isVirtualScreenshareParticipant }
  76. moderator = { true }
  77. participantID = { participantId }
  78. screenshare = { _isMultiStreamEnabled
  79. ? isVirtualScreenshareParticipant
  80. : thumbnailType === THUMBNAIL_TYPE.TILE }
  81. thumbnailType = { thumbnailType } />
  82. }
  83. {
  84. _showDisplayName && (
  85. <span className = { styles.nameContainer }>
  86. <DisplayName
  87. allowEditing = { local ? _allowEditing : false }
  88. displayNameSuffix = { local ? _defaultLocalDisplayName : '' }
  89. elementID = { local ? 'localDisplayName' : `participant_${participantId}_name` }
  90. participantID = { participantId }
  91. thumbnailType = { thumbnailType } />
  92. </span>
  93. )
  94. }
  95. </div>);
  96. };
  97. export default ThumbnailBottomIndicators;