From d72813340e6f3a2501b1b7cda434a0999ac3c55c Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Sun, 11 Dec 2016 17:39:31 -0600 Subject: [PATCH] Fix the (visual) style of toggle camera facing mode --- .../toolbar/components/Toolbar.native.js | 117 +++++++++++------- react/features/toolbar/components/styles.js | 40 +++--- 2 files changed, 92 insertions(+), 65 deletions(-) diff --git a/react/features/toolbar/components/Toolbar.native.js b/react/features/toolbar/components/Toolbar.native.js index a2ac08875..a01254a6d 100644 --- a/react/features/toolbar/components/Toolbar.native.js +++ b/react/features/toolbar/components/Toolbar.native.js @@ -2,17 +2,11 @@ import React from 'react'; import { View } from 'react-native'; import { connect } from 'react-redux'; -import { - MEDIA_TYPE, - toggleCameraFacingMode -} from '../../base/media'; +import { MEDIA_TYPE, toggleCameraFacingMode } from '../../base/media'; import { Container } from '../../base/react'; import { ColorPalette } from '../../base/styles'; -import { - AbstractToolbar, - mapStateToProps -} from './AbstractToolbar'; +import { AbstractToolbar, mapStateToProps } from './AbstractToolbar'; import { styles } from './styles'; import ToolbarButton from './ToolbarButton'; @@ -50,50 +44,81 @@ class Toolbar extends AbstractToolbar { * @returns {ReactElement} */ render() { - const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO); - const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO); - const underlayColor = ColorPalette.buttonUnderlay; - - // TODO Use correct Jitsi icon for camera switch button when available. - - /* eslint-disable react/jsx-handler-names */ - return ( - - - - - - - - - + { + this._renderPrimaryToolbar() + } + { + this._renderSecondaryToolbar() + } ); + } + + /** + * Renders the toolbar which contains the primary buttons such as hangup, + * audio and video mute. + * + * @private + * @returns {ReactElement} + */ + _renderPrimaryToolbar() { + const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO); + const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO); + + /* eslint-disable react/jsx-handler-names */ + + return ( + + + + + + ); + + /* eslint-enable react/jsx-handler-names */ + } + + /** + * Renders the toolbar which contains the secondary buttons such as toggle + * camera facing mode. + * + * @private + * @returns {ReactElement} + */ + _renderSecondaryToolbar() { + /* eslint-disable react/jsx-handler-names */ + + // TODO Use an appropriate icon for toggle camera facing mode. + return ( + + + + ); /* eslint-enable react/jsx-handler-names */ } diff --git a/react/features/toolbar/components/styles.js b/react/features/toolbar/components/styles.js index a45f7188d..96cc13f71 100644 --- a/react/features/toolbar/components/styles.js +++ b/react/features/toolbar/components/styles.js @@ -52,6 +52,27 @@ export const styles = createStyleSheet({ color: ColorPalette.darkGrey }, + /** + * The style of the toolbar which contains the primary buttons such as + * hangup, audio and video mute. + */ + primaryToolbar: { + ...container, + bottom: 30, + height: 60, + justifyContent: 'center' + }, + + /** + * The style of the toolbar which contains the secondary buttons such as + * toggle camera facing mode. + */ + secondaryToolbar: { + ...container, + height: 60, + justifyContent: 'flex-end' + }, + /** * The toggle camera facing mode button style. */ @@ -60,15 +81,6 @@ export const styles = createStyleSheet({ backgroundColor: 'transparent' }, - /** - * Container for toggle camera facing mode button. - */ - toggleCameraFacingModeContainer: { - ...container, - height: 60, - justifyContent: 'flex-end' - }, - /** * The toolbar button style. */ @@ -80,16 +92,6 @@ export const styles = createStyleSheet({ opacity: 0.8 }, - /** - * The toolbar buttons container style. - */ - toolbarButtonsContainer: { - ...container, - bottom: 30, - height: 60, - justifyContent: 'center' - }, - /** * The toolbar container style. */