From 320cfe4745581dae3c88847d6a6d34d1fc97d537 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Thu, 19 Oct 2017 13:19:32 -0500 Subject: [PATCH] ref(base/react/Container): return null for not visible Now that we no longer hide the filmstrip it is fine to return null instead of trying to hide with some tricks. --- .../base/react/components/native/Container.js | 27 +++++++------------ .../toolbox/components/Toolbox.native.js | 7 ++--- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/react/features/base/react/components/native/Container.js b/react/features/base/react/components/native/Container.js index 0cb3bd5e0..2e011868f 100644 --- a/react/features/base/react/components/native/Container.js +++ b/react/features/base/react/components/native/Container.js @@ -7,7 +7,6 @@ import { View } from 'react-native'; -import { Platform } from '../../'; import AbstractContainer from '../AbstractContainer'; /** @@ -39,28 +38,20 @@ export default class Container extends AbstractContainer { // visible if (!visible) { - // FIXME: It turns out that display: none will fail on some Android - // devices, but work on the others (currently fails on Google Pixel) - if (Platform.OS === 'android') { - return null; - } - - // Intentionally hide this Container without destroying it. - props.style = { - ...props.style, - display: 'none' - }; + return null; } let element = super._render(View, props); // onClick & touchFeedback - if (visible && (onClick || touchFeedback)) { - element = React.createElement( - touchFeedback ? TouchableHighlight : TouchableWithoutFeedback, - { onPress: onClick }, - element - ); + if (element && (onClick || touchFeedback)) { + element + = React.createElement( + touchFeedback + ? TouchableHighlight + : TouchableWithoutFeedback, + { onPress: onClick }, + element); } return element; diff --git a/react/features/toolbox/components/Toolbox.native.js b/react/features/toolbox/components/Toolbox.native.js index c420fc967..97cce7cb4 100644 --- a/react/features/toolbox/components/Toolbox.native.js +++ b/react/features/toolbox/components/Toolbox.native.js @@ -120,16 +120,13 @@ class Toolbox extends Component { * @returns {ReactElement} */ render() { - if (!this.props._visible) { - return null; - } - return ( + : styles.toolbarContainerWide } + visible = { this.props._visible } > { isNarrowAspectRatio(this) ? this._renderSecondaryToolbar()