Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fix the (visual) style of toggle camera facing mode

Lyubomir Marinovd72813340e6f
diff --git a/react/features/toolbar/components/Toolbar.native.js b/react/features/toolbar/components/Toolbar.native.js
index a2ac08875a..a01254a6d0 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,49 +44,80 @@ class Toolbar extends AbstractToolbar {
* @returns {ReactElement}
*/
render() {
+ return (
+ <Container
+ style = { styles.toolbarContainer }
+ visible = { this.props.visible }>
+ {
+ this._renderPrimaryToolbar()
+ }
+ {
+ this._renderSecondaryToolbar()
+ }
+ </Container>
+ );
+ }
+
+ /**
+ * 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);
- const underlayColor = ColorPalette.buttonUnderlay;
-
- // TODO Use correct Jitsi icon for camera switch button when available.
/* eslint-disable react/jsx-handler-names */
return (
- <Container
- style = { styles.toolbarContainer }
- visible = { this.props.visible }>
+ <View style = { styles.primaryToolbar }>
+ <ToolbarButton
+ iconName = { audioButtonStyles.iconName }
+ iconStyle = { audioButtonStyles.iconStyle }
+ onClick = { this._toggleAudio }
+ style = { audioButtonStyles.buttonStyle } />
+ <ToolbarButton
+ iconName = 'hangup'
+ iconStyle = { styles.whiteIcon }
+ onClick = { this._onHangup }
+ style = {{
+ ...styles.toolbarButton,
+ backgroundColor: ColorPalette.red
+ }}
+ underlayColor = { ColorPalette.buttonUnderlay } />
+ <ToolbarButton
+ iconName = { videoButtonStyles.iconName }
+ iconStyle = { videoButtonStyles.iconStyle }
+ onClick = { this._toggleVideo }
+ style = { videoButtonStyles.buttonStyle } />
+ </View>
+ );
- <View style = { styles.toggleCameraFacingModeContainer }>
- <ToolbarButton
- iconName = 'reload'
- iconstyle = { styles.whiteIcon }
- onClick = { this._toggleCameraFacingMode }
- style = { styles.toggleCameraFacingModeButton }
- underlayColor = 'transparent' />
- </View>
- <View style = { styles.toolbarButtonsContainer }>
- <ToolbarButton
- iconName = { audioButtonStyles.iconName }
- iconStyle = { audioButtonStyles.iconStyle }
- onClick = { this._toggleAudio }
- style = { audioButtonStyles.buttonStyle } />
- <ToolbarButton
- iconName = 'hangup'
- iconStyle = { styles.whiteIcon }
- onClick = { this._onHangup }
- style = {{
- ...styles.toolbarButton,
- backgroundColor: ColorPalette.red
- }}
- underlayColor = { underlayColor } />
- <ToolbarButton
- iconName = { videoButtonStyles.iconName }
- iconStyle = { videoButtonStyles.iconStyle }
- onClick = { this._toggleVideo }
- style = { videoButtonStyles.buttonStyle } />
- </View>
- </Container>
+ /* 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 (
+ <View style = { styles.secondaryToolbar }>
+ <ToolbarButton
+ iconName = 'reload'
+ iconStyle = { styles.whiteIcon }
+ onClick = { this._toggleCameraFacingMode }
+ style = { styles.toggleCameraFacingModeButton }
+ underlayColor = 'transparent' />
+ </View>
);
/* eslint-enable react/jsx-handler-names */
diff --git a/react/features/toolbar/components/styles.js b/react/features/toolbar/components/styles.js
index a45f7188db..96cc13f71c 100644
--- a/react/features/toolbar/components/styles.js
+++ b/react/features/toolbar/components/styles.js
@@ -53,22 +53,34 @@ export const styles = createStyleSheet({
},
/**
- * The toggle camera facing mode button style.
+ * The style of the toolbar which contains the primary buttons such as
+ * hangup, audio and video mute.
*/
- toggleCameraFacingModeButton: {
- ...button,
- backgroundColor: 'transparent'
+ primaryToolbar: {
+ ...container,
+ bottom: 30,
+ height: 60,
+ justifyContent: 'center'
},
/**
- * Container for toggle camera facing mode button.
+ * The style of the toolbar which contains the secondary buttons such as
+ * toggle camera facing mode.
*/
- toggleCameraFacingModeContainer: {
+ secondaryToolbar: {
...container,
height: 60,
justifyContent: 'flex-end'
},
+ /**
+ * The toggle camera facing mode button style.
+ */
+ toggleCameraFacingModeButton: {
+ ...button,
+ backgroundColor: 'transparent'
+ },
+
/**
* 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.
*/