2022-07-18 13:16:08 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-11-11 11:11:30 +00:00
|
|
|
|
2022-05-06 10:14:10 +00:00
|
|
|
import React from 'react';
|
2022-07-11 12:30:37 +00:00
|
|
|
import { StyleProp, Text, View, ViewStyle } from 'react-native';
|
2022-06-17 10:08:21 +00:00
|
|
|
import { useSelector } from 'react-redux';
|
2022-05-06 10:14:10 +00:00
|
|
|
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState } from '../../../../app/types';
|
2022-05-06 10:14:10 +00:00
|
|
|
import { getConferenceName } from '../../../../base/conference/functions';
|
2022-10-11 10:47:54 +00:00
|
|
|
import { MEETING_NAME_ENABLED } from '../../../../base/flags/constants';
|
|
|
|
import { getFeatureFlag } from '../../../../base/flags/functions';
|
2022-05-06 10:14:10 +00:00
|
|
|
import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
|
2022-08-08 08:12:22 +00:00
|
|
|
import { getLocalParticipant } from '../../../../base/participants/functions';
|
2022-07-18 13:16:08 +00:00
|
|
|
import { connect } from '../../../../base/redux/functions';
|
|
|
|
// @ts-ignore
|
2022-07-11 12:30:37 +00:00
|
|
|
import ConnectionIndicator from '../../../../connection-indicator/components/native/ConnectionIndicator';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-11 12:30:37 +00:00
|
|
|
import RecordingLabel from '../../../../recording/components/native/RecordingLabel';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-05-06 10:14:10 +00:00
|
|
|
import { VideoQualityLabel } from '../../../../video-quality';
|
|
|
|
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-05-06 10:14:10 +00:00
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
interface IProps {
|
2022-05-06 10:14:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the meeting we're currently in.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_meetingName: string;
|
2022-05-06 10:14:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether displaying the current meeting name is enabled or not.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_meetingNameEnabled: boolean;
|
2022-05-06 10:14:10 +00:00
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
}
|
2022-05-06 10:14:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a navigation bar component that is rendered on top of the
|
|
|
|
* carmode screen.
|
|
|
|
*
|
2022-11-03 08:35:51 +00:00
|
|
|
* @param {IProps} props - The React props passed to this component.
|
2022-05-06 10:14:10 +00:00
|
|
|
* @returns {JSX.Element}
|
|
|
|
*/
|
2022-11-03 08:35:51 +00:00
|
|
|
const TitleBar = (props: IProps): JSX.Element => {
|
2022-09-06 17:32:20 +00:00
|
|
|
const localParticipant = useSelector(getLocalParticipant);
|
2022-06-17 10:08:21 +00:00
|
|
|
const localParticipantId = localParticipant?.id;
|
|
|
|
|
|
|
|
return (<>
|
2022-05-06 10:14:10 +00:00
|
|
|
<View
|
|
|
|
pointerEvents = 'box-none'
|
2022-07-11 12:30:37 +00:00
|
|
|
style = { styles.titleBarWrapper as StyleProp<ViewStyle> }>
|
2022-06-17 10:08:21 +00:00
|
|
|
<View
|
|
|
|
pointerEvents = 'box-none'
|
2022-07-11 12:30:37 +00:00
|
|
|
style = { styles.roomNameWrapper as StyleProp<ViewStyle> }>
|
|
|
|
<View style = { styles.qualityLabelContainer as StyleProp<ViewStyle> }>
|
2022-06-17 10:08:21 +00:00
|
|
|
<VideoQualityLabel />
|
|
|
|
</View>
|
|
|
|
<ConnectionIndicator
|
2022-11-11 11:11:30 +00:00
|
|
|
// @ts-ignore
|
2022-07-11 12:30:37 +00:00
|
|
|
iconStyle = { styles.connectionIndicatorIcon }
|
2022-11-11 11:11:30 +00:00
|
|
|
// @ts-ignore
|
2022-07-11 12:30:37 +00:00
|
|
|
participantId = { localParticipantId } />
|
|
|
|
<View style = { styles.headerLabels as StyleProp<ViewStyle> }>
|
2022-06-17 10:08:21 +00:00
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
|
|
</View>
|
2022-05-06 10:14:10 +00:00
|
|
|
|
2022-06-17 10:08:21 +00:00
|
|
|
{
|
|
|
|
props._meetingNameEnabled
|
2022-07-11 12:30:37 +00:00
|
|
|
&& <View style = { styles.roomNameView as StyleProp<ViewStyle> }>
|
2022-06-17 10:08:21 +00:00
|
|
|
<Text
|
|
|
|
numberOfLines = { 1 }
|
|
|
|
style = { styles.roomName }>
|
|
|
|
{props._meetingName}
|
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
}
|
2022-05-06 10:14:10 +00:00
|
|
|
</View>
|
|
|
|
</View>
|
2022-06-17 10:08:21 +00:00
|
|
|
</>);
|
2022-07-11 12:30:37 +00:00
|
|
|
};
|
2022-05-06 10:14:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps part of the Redux store to the props of this component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
2022-11-03 08:35:51 +00:00
|
|
|
* @returns {IProps}
|
2022-05-06 10:14:10 +00:00
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
function _mapStateToProps(state: IReduxState) {
|
2022-05-06 10:14:10 +00:00
|
|
|
const { hideConferenceSubject } = state['features/base/config'];
|
|
|
|
|
|
|
|
return {
|
|
|
|
_meetingName: getConferenceName(state),
|
|
|
|
_meetingNameEnabled:
|
|
|
|
getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(TitleBar);
|