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.

SpeakerStatsItem.tsx 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import React from 'react';
  2. import { Text, View, ViewStyle } from 'react-native';
  3. import Avatar from '../../../base/avatar/components/Avatar';
  4. import StatelessAvatar from '../../../base/avatar/components/native/StatelessAvatar';
  5. import { getInitials } from '../../../base/avatar/functions';
  6. import BaseTheme from '../../../base/ui/components/BaseTheme.native';
  7. import TimeElapsed from './TimeElapsed';
  8. import style from './styles';
  9. interface IProps {
  10. /**
  11. * The name of the participant.
  12. */
  13. displayName: string;
  14. /**
  15. * The total milliseconds the participant has been dominant speaker.
  16. */
  17. dominantSpeakerTime: number;
  18. /**
  19. * True if the participant is no longer in the meeting.
  20. */
  21. hasLeft: boolean;
  22. /**
  23. * True if the participant is currently the dominant speaker.
  24. */
  25. isDominantSpeaker: boolean;
  26. /**
  27. * The id of the user.
  28. */
  29. participantId: string;
  30. }
  31. const SpeakerStatsItem = (props: IProps) =>
  32. (
  33. <View
  34. key = { props.participantId }
  35. style = { style.speakerStatsItemContainer as ViewStyle }>
  36. <View style = { style.speakerStatsAvatar }>
  37. {
  38. props.hasLeft ? (
  39. <StatelessAvatar
  40. color = { BaseTheme.palette.ui05 }
  41. initials = { getInitials(props.displayName) }
  42. size = { BaseTheme.spacing[5] } />
  43. ) : (
  44. <Avatar
  45. className = 'userAvatar'
  46. participantId = { props.participantId }
  47. size = { BaseTheme.spacing[5] } />
  48. )
  49. }
  50. </View>
  51. <View style = { style.speakerStatsNameTime as ViewStyle } >
  52. <Text style = { [ style.speakerStatsText, props.hasLeft && style.speakerStatsLeft ] }>
  53. {props.displayName}
  54. </Text>
  55. <TimeElapsed
  56. style = { [
  57. style.speakerStatsText,
  58. style.speakerStatsTime,
  59. props.isDominantSpeaker && style.speakerStatsDominant,
  60. props.hasLeft && style.speakerStatsLeft
  61. ] }
  62. time = { props.dominantSpeakerTime } />
  63. </View>
  64. </View>
  65. );
  66. export default SpeakerStatsItem;