2022-05-06 10:14:10 +00:00
|
|
|
import React from 'react';
|
2022-06-17 10:08:21 +00:00
|
|
|
import { useSelector } from 'react-redux';
|
2022-05-06 10:14:10 +00:00
|
|
|
import { Text, View } from 'react-native';
|
|
|
|
|
|
|
|
import { getConferenceName } from '../../../../base/conference/functions';
|
2022-06-17 10:08:21 +00:00
|
|
|
import { ConnectionIndicator } from '../../../../connection-indicator';
|
2022-05-06 10:14:10 +00:00
|
|
|
import { getFeatureFlag, MEETING_NAME_ENABLED } from '../../../../base/flags';
|
|
|
|
import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
|
|
|
|
import { connect } from '../../../../base/redux';;
|
|
|
|
import { RecordingLabel } from '../../../../recording';
|
|
|
|
import { VideoQualityLabel } from '../../../../video-quality';
|
|
|
|
|
2022-06-17 10:08:21 +00:00
|
|
|
import { getLocalParticipant } from '../../../../base/participants';
|
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 => {
|
|
|
|
const localParticipant = useSelector(getLocalParticipant);
|
|
|
|
const localParticipantId = localParticipant?.id;
|
|
|
|
|
|
|
|
return (<>
|
2022-05-06 10:14:10 +00:00
|
|
|
<View
|
|
|
|
pointerEvents = 'box-none'
|
2022-06-17 10:08:21 +00:00
|
|
|
style = { styles.titleBarWrapper }>
|
|
|
|
<View
|
|
|
|
pointerEvents = 'box-none'
|
|
|
|
style = { styles.roomNameWrapper }>
|
|
|
|
<View style = { styles.qualityLabelContainer }>
|
|
|
|
<VideoQualityLabel />
|
|
|
|
</View>
|
|
|
|
<ConnectionIndicator
|
|
|
|
participantId = { localParticipantId }
|
|
|
|
iconStyle = { styles.connectionIndicatorIcon } />
|
|
|
|
<View style = { styles.headerLabels }>
|
|
|
|
<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
|
|
|
|
&& <View style = { styles.roomNameView }>
|
|
|
|
<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-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}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state: Object) {
|
|
|
|
const { hideConferenceSubject } = state['features/base/config'];
|
|
|
|
|
|
|
|
return {
|
|
|
|
_meetingName: getConferenceName(state),
|
|
|
|
_meetingNameEnabled:
|
|
|
|
getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(TitleBar);
|