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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // @flow
  2. import React from 'react';
  3. import { Text, View } from 'react-native';
  4. import { getConferenceName } from '../../../base/conference';
  5. import { getFeatureFlag, CONFERENCE_TIMER_ENABLED, MEETING_NAME_ENABLED } from '../../../base/flags';
  6. import { connect } from '../../../base/redux';
  7. import { PictureInPictureButton } from '../../../mobile/picture-in-picture';
  8. import { isToolboxVisible } from '../../../toolbox/functions.native';
  9. import ConferenceTimer from '../ConferenceTimer';
  10. import Labels from './Labels';
  11. import styles from './styles';
  12. type Props = {
  13. /**
  14. * Whether displaying the current conference timer is enabled or not.
  15. */
  16. _conferenceTimerEnabled: boolean,
  17. /**
  18. * Name of the meeting we're currently in.
  19. */
  20. _meetingName: string,
  21. /**
  22. * Whether displaying the current meeting name is enabled or not.
  23. */
  24. _meetingNameEnabled: boolean,
  25. /**
  26. * True if the navigation bar should be visible.
  27. */
  28. _visible: boolean
  29. };
  30. /**
  31. * Implements a navigation bar component that is rendered on top of the
  32. * conference screen.
  33. *
  34. * @param {Props} props - The React props passed to this component.
  35. * @returns {React.Node}
  36. */
  37. const NavigationBar = (props: Props) => {
  38. if (!props._visible) {
  39. return null;
  40. }
  41. return (
  42. <View
  43. pointerEvents = 'box-none'
  44. style = { styles.navBarWrapper }>
  45. <PictureInPictureButton
  46. styles = { styles.navBarButton } />
  47. <View
  48. pointerEvents = 'box-none'
  49. style = { styles.roomNameContainer }>
  50. <View
  51. pointerEvents = 'box-none'
  52. style = { styles.roomNameWrapper }>
  53. {
  54. props._meetingNameEnabled
  55. && <View style = { styles.roomNameView }>
  56. <Text
  57. numberOfLines = { 1 }
  58. style = { styles.roomName }>
  59. { props._meetingName }
  60. </Text>
  61. </View>
  62. }
  63. {
  64. props._conferenceTimerEnabled
  65. && <View style = { styles.roomTimerView }>
  66. <ConferenceTimer textStyle = { styles.roomTimer } />
  67. </View>
  68. }
  69. </View>
  70. <Labels />
  71. </View>
  72. </View>
  73. );
  74. };
  75. /**
  76. * Maps part of the Redux store to the props of this component.
  77. *
  78. * @param {Object} state - The Redux state.
  79. * @returns {Props}
  80. */
  81. function _mapStateToProps(state) {
  82. const { hideConferenceTimer, hideConferenceSubject } = state['features/base/config'];
  83. return {
  84. _conferenceTimerEnabled:
  85. getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !hideConferenceTimer,
  86. _meetingName: getConferenceName(state),
  87. _meetingNameEnabled:
  88. getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject,
  89. _visible: isToolboxVisible(state)
  90. };
  91. }
  92. export default connect(_mapStateToProps)(NavigationBar);