feat(conference/native) - hide label in one to one meeting

This commit is contained in:
Calin Chitu 2022-04-06 15:06:48 +03:00 committed by Saúl Ibarra Corretgé
parent bdd8400057
commit ec78cf2784
1 changed files with 18 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import { withSafeAreaInsets } from 'react-native-safe-area-context';
import { appNavigate } from '../../../app/actions'; import { appNavigate } from '../../../app/actions';
import { PIP_ENABLED, FULLSCREEN_ENABLED, getFeatureFlag } from '../../../base/flags'; import { PIP_ENABLED, FULLSCREEN_ENABLED, getFeatureFlag } from '../../../base/flags';
import { getParticipantCount } from '../../../base/participants';
import { Container, LoadingIndicator, TintedView } from '../../../base/react'; import { Container, LoadingIndicator, TintedView } from '../../../base/react';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants'; import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
@ -76,6 +77,11 @@ type Props = AbstractProps & {
*/ */
_fullscreenEnabled: boolean, _fullscreenEnabled: boolean,
/**
* The indicator which determines if the conference type is one to one.
*/
_isOneToOneConference: boolean,
/** /**
* The indicator which determines if the participants pane is open. * The indicator which determines if the participants pane is open.
*/ */
@ -315,6 +321,7 @@ class Conference extends AbstractConference<Props, State> {
_renderContent() { _renderContent() {
const { const {
_connecting, _connecting,
_isOneToOneConference,
_largeVideoParticipantId, _largeVideoParticipantId,
_reducedUI, _reducedUI,
_shouldDisplayTileView, _shouldDisplayTileView,
@ -357,9 +364,15 @@ class Conference extends AbstractConference<Props, State> {
<Captions onPress = { this._onClick } /> <Captions onPress = { this._onClick } />
{ _shouldDisplayTileView || <Container style = { styles.displayNameContainer }> {
<DisplayNameLabel participantId = { _largeVideoParticipantId } /> _shouldDisplayTileView || (
</Container> } !_isOneToOneConference
&& <Container style = { styles.displayNameContainer }>
<DisplayNameLabel
participantId = { _largeVideoParticipantId } />
</Container>
)
}
<LonelyMeetingExperience /> <LonelyMeetingExperience />
@ -492,6 +505,7 @@ function _mapStateToProps(state) {
} = state['features/base/conference']; } = state['features/base/conference'];
const { isOpen } = state['features/participants-pane']; const { isOpen } = state['features/participants-pane'];
const { aspectRatio, reducedUI } = state['features/base/responsive-ui']; const { aspectRatio, reducedUI } = state['features/base/responsive-ui'];
const participantCount = getParticipantCount(state);
// XXX There is a window of time between the successful establishment of the // XXX There is a window of time between the successful establishment of the
// XMPP connection and the subsequent commencement of joining the MUC during // XMPP connection and the subsequent commencement of joining the MUC during
@ -512,6 +526,7 @@ function _mapStateToProps(state) {
_connecting: Boolean(connecting_), _connecting: Boolean(connecting_),
_filmstripVisible: isFilmstripVisible(state), _filmstripVisible: isFilmstripVisible(state),
_fullscreenEnabled: getFeatureFlag(state, FULLSCREEN_ENABLED, true), _fullscreenEnabled: getFeatureFlag(state, FULLSCREEN_ENABLED, true),
_isOneToOneConference: Boolean(participantCount === 2),
_isParticipantsPaneOpen: isOpen, _isParticipantsPaneOpen: isOpen,
_largeVideoParticipantId: state['features/large-video'].participantId, _largeVideoParticipantId: state['features/large-video'].participantId,
_pictureInPictureEnabled: getFeatureFlag(state, PIP_ENABLED), _pictureInPictureEnabled: getFeatureFlag(state, PIP_ENABLED),