Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* eslint-disable lines-around-comment */
  2. import React from 'react';
  3. import { StyleProp, Text, View, ViewStyle } from 'react-native';
  4. import { useSelector } from 'react-redux';
  5. import { IReduxState } from '../../../../app/types';
  6. import { getConferenceName } from '../../../../base/conference/functions';
  7. import { MEETING_NAME_ENABLED } from '../../../../base/flags/constants';
  8. import { getFeatureFlag } from '../../../../base/flags/functions';
  9. import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
  10. import { getLocalParticipant } from '../../../../base/participants/functions';
  11. import { connect } from '../../../../base/redux/functions';
  12. // @ts-ignore
  13. import ConnectionIndicator from '../../../../connection-indicator/components/native/ConnectionIndicator';
  14. // @ts-ignore
  15. import RecordingLabel from '../../../../recording/components/native/RecordingLabel';
  16. // @ts-ignore
  17. import { VideoQualityLabel } from '../../../../video-quality';
  18. // @ts-ignore
  19. import styles from './styles';
  20. interface IProps {
  21. /**
  22. * Name of the meeting we're currently in.
  23. */
  24. _meetingName: string;
  25. /**
  26. * Whether displaying the current meeting name is enabled or not.
  27. */
  28. _meetingNameEnabled: boolean;
  29. }
  30. /**
  31. * Implements a navigation bar component that is rendered on top of the
  32. * carmode screen.
  33. *
  34. * @param {IProps} props - The React props passed to this component.
  35. * @returns {JSX.Element}
  36. */
  37. const TitleBar = (props: IProps): JSX.Element => {
  38. const localParticipant = useSelector(getLocalParticipant);
  39. const localParticipantId = localParticipant?.id;
  40. return (<>
  41. <View
  42. pointerEvents = 'box-none'
  43. style = { styles.titleBarWrapper as StyleProp<ViewStyle> }>
  44. <View
  45. pointerEvents = 'box-none'
  46. style = { styles.roomNameWrapper as StyleProp<ViewStyle> }>
  47. <View style = { styles.qualityLabelContainer as StyleProp<ViewStyle> }>
  48. <VideoQualityLabel />
  49. </View>
  50. <ConnectionIndicator
  51. // @ts-ignore
  52. iconStyle = { styles.connectionIndicatorIcon }
  53. // @ts-ignore
  54. participantId = { localParticipantId } />
  55. <View style = { styles.headerLabels as StyleProp<ViewStyle> }>
  56. <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
  57. <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
  58. </View>
  59. {
  60. props._meetingNameEnabled
  61. && <View style = { styles.roomNameView as StyleProp<ViewStyle> }>
  62. <Text
  63. numberOfLines = { 1 }
  64. style = { styles.roomName }>
  65. { props._meetingName }
  66. </Text>
  67. </View>
  68. }
  69. </View>
  70. </View>
  71. </>);
  72. };
  73. /**
  74. * Maps part of the Redux store to the props of this component.
  75. *
  76. * @param {Object} state - The Redux state.
  77. * @returns {IProps}
  78. */
  79. function _mapStateToProps(state: IReduxState) {
  80. const { hideConferenceSubject } = state['features/base/config'];
  81. return {
  82. _meetingName: getConferenceName(state),
  83. _meetingNameEnabled:
  84. getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject
  85. };
  86. }
  87. export default connect(_mapStateToProps)(TitleBar);