[RN] Adjust Conference for the reduced UI mode (Coding style)

This commit is contained in:
Lyubo Marinov 2018-02-13 13:14:06 -06:00
parent 7a9ff9975a
commit 0bbcd3181c
3 changed files with 13 additions and 10 deletions

View File

@ -67,7 +67,8 @@ type Props = {
_onHardwareBackPress: Function,
/**
* The indicator which determines if we are in reduced UI mode.
* The indicator which determines whether the UI is reduced (to accommodate
* smaller display areas).
*
* @private
*/
@ -200,7 +201,7 @@ class Conference extends Component<Props> {
{/*
* If there is a ringing call, show the callee's info.
*/
!this.props._reducedUI && <CalleeInfoContainer />
this.props._reducedUI || <CalleeInfoContainer />
}
{/*
@ -232,7 +233,7 @@ class Conference extends Component<Props> {
{/*
* The dialogs are in the topmost stacking layers.
*/
!this.props._reducedUI && <DialogContainer />
this.props._reducedUI || <DialogContainer />
}
</Container>
);
@ -370,6 +371,7 @@ function _mapDispatchToProps(dispatch) {
* @private
* @returns {{
* _connecting: boolean,
* _reducedUI: boolean,
* _toolboxVisible: boolean
* }}
*/
@ -403,7 +405,8 @@ function _mapStateToProps(state) {
_connecting: Boolean(connecting_),
/**
* The indicator which determines if we are in reduced UI mode.
* The indicator which determines whether the UI is reduced (to
* accommodate smaller display areas).
*
* @private
* @type {boolean}

View File

@ -1,5 +1,4 @@
import './route';
export * from './components';
import './middleware';
import './route';

View File

@ -10,12 +10,13 @@ import { MiddlewareRegistry } from '../base/redux';
import { setFilmstripEnabled } from '../filmstrip';
import { setToolboxEnabled } from '../toolbox';
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
MiddlewareRegistry.register(store => next => action => {
const result = next(action);
switch (action.type) {
case CONFERENCE_JOINED:
case SET_REDUCED_UI: {
const { dispatch, getState } = store;
const state = getState();
const { audioOnly } = state['features/base/conference'];
const { reducedUI } = state['features/base/responsive-ui'];
@ -25,12 +26,12 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
// XXX: Currently setting the received video quality will disable
// audio-only mode if engaged, that's why we check for it here.
if (!audioOnly) {
dispatch(setReceiveVideoQuality(
audioOnly
|| dispatch(
setReceiveVideoQuality(
reducedUI
? VIDEO_QUALITY_LEVELS.LOW
: VIDEO_QUALITY_LEVELS.HIGH));
}
break;
}