2022-07-18 13:16:08 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
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-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-05-06 10:14:10 +00:00
|
|
|
import { getConferenceName } from '../../../../base/conference/functions';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-05-06 10:14:10 +00:00
|
|
|
import { getFeatureFlag, MEETING_NAME_ENABLED } from '../../../../base/flags';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-05-06 10:14:10 +00:00
|
|
|
import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-11 12:30:37 +00:00
|
|
|
import { getLocalParticipant } from '../../../../base/participants';
|
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';
|
|
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the meeting we're currently in.
|
|
|
|
*/
|
|
|
|
_meetingName: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether displaying the current meeting name is enabled or not.
|
|
|
|
*/
|
|
|
|
_meetingNameEnabled: boolean,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a navigation bar component that is rendered on top of the
|
|
|
|
* carmode screen.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The React props passed to this component.
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
*/
|
2022-06-17 10:08:21 +00:00
|
|
|
const TitleBar = (props: Props) : JSX.Element => {
|
2022-07-18 13:16:08 +00:00
|
|
|
const localParticipant: any = 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-07-11 12:30:37 +00:00
|
|
|
iconStyle = { styles.connectionIndicatorIcon }
|
|
|
|
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.
|
|
|
|
* @returns {Props}
|
|
|
|
*/
|
2022-07-18 13:16:08 +00:00
|
|
|
function _mapStateToProps(state: any) {
|
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);
|