2019-01-30 15:43:57 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { SafeAreaView, Text, View } from 'react-native';
|
|
|
|
import LinearGradient from 'react-native-linear-gradient';
|
|
|
|
|
|
|
|
import { getConferenceName } from '../../../base/conference';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2019-01-30 15:43:57 +00:00
|
|
|
import { PictureInPictureButton } from '../../../mobile/picture-in-picture';
|
|
|
|
import { isToolboxVisible } from '../../../toolbox';
|
|
|
|
|
|
|
|
import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the meeting we're currently in.
|
|
|
|
*/
|
|
|
|
_meetingName: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* True if the navigation bar should be visible.
|
|
|
|
*/
|
|
|
|
_visible: boolean
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a navigation bar component that is rendered on top of the
|
|
|
|
* conference screen.
|
|
|
|
*/
|
|
|
|
class NavigationBar extends Component<Props> {
|
|
|
|
/**
|
|
|
|
* Implements {@Component#render}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
if (!this.props._visible) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-03-20 20:09:23 +00:00
|
|
|
return [
|
|
|
|
<LinearGradient
|
|
|
|
colors = { NAVBAR_GRADIENT_COLORS }
|
|
|
|
key = { 1 }
|
|
|
|
pointerEvents = 'none'
|
|
|
|
style = { styles.gradient }>
|
|
|
|
<SafeAreaView>
|
2019-07-12 13:03:14 +00:00
|
|
|
<View style = { styles.gradientStretchTop } />
|
2019-03-20 20:09:23 +00:00
|
|
|
</SafeAreaView>
|
|
|
|
</LinearGradient>,
|
2019-01-30 15:43:57 +00:00
|
|
|
<View
|
2019-03-20 20:09:23 +00:00
|
|
|
key = { 2 }
|
2019-01-30 15:43:57 +00:00
|
|
|
pointerEvents = 'box-none'
|
2019-03-20 20:09:23 +00:00
|
|
|
style = { styles.navBarWrapper }>
|
|
|
|
<PictureInPictureButton
|
|
|
|
styles = { styles.navBarButton } />
|
|
|
|
<View
|
2019-01-30 15:43:57 +00:00
|
|
|
pointerEvents = 'box-none'
|
2019-03-20 20:09:23 +00:00
|
|
|
style = { styles.roomNameWrapper }>
|
|
|
|
<Text
|
|
|
|
numberOfLines = { 1 }
|
|
|
|
style = { styles.roomName }>
|
|
|
|
{ this.props._meetingName }
|
|
|
|
</Text>
|
|
|
|
</View>
|
2019-01-30 15:43:57 +00:00
|
|
|
</View>
|
2019-03-20 20:09:23 +00:00
|
|
|
];
|
2019-01-30 15:43:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps part of the Redux store to the props of this component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @returns {{
|
|
|
|
* _meetingName: string,
|
|
|
|
* _visible: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
return {
|
2019-05-29 07:53:12 +00:00
|
|
|
_meetingName: getConferenceName(state),
|
2019-01-30 15:43:57 +00:00
|
|
|
_visible: isToolboxVisible(state)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(NavigationBar);
|