feat(live-streaming): add beta tag to mobile

This commit is contained in:
Leonard Kim 2018-07-17 10:49:58 -07:00 committed by Saúl Ibarra Corretgé
parent d3dd54ac3b
commit f97f294d1a
6 changed files with 40 additions and 19 deletions

View File

@ -51,6 +51,7 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
_renderItem() { _renderItem() {
const { const {
disabled, disabled,
elementAfter,
onClick, onClick,
showLabel, showLabel,
styles styles
@ -72,6 +73,7 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
<Text style = { styles && styles.labelStyle }> <Text style = { styles && styles.labelStyle }>
{ this.label } { this.label }
</Text> </Text>
{ elementAfter }
</View> </View>
); );

View File

@ -1,11 +1,13 @@
// @flow // @flow
import React from 'react';
import { openDialog } from '../../../base/dialog'; import { openDialog } from '../../../base/dialog';
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet'; import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
import { import {
isLocalParticipantModerator, isLocalParticipantModerator,
getLocalParticipant getLocalParticipant
} from '../../../base/participants'; } from '../../../base/participants';
import { Container, Text } from '../../../base/react';
import { import {
AbstractButton, AbstractButton,
type AbstractButtonProps type AbstractButtonProps
@ -15,6 +17,7 @@ import { getActiveSession } from '../../functions';
import StartLiveStreamDialog from './StartLiveStreamDialog'; import StartLiveStreamDialog from './StartLiveStreamDialog';
import StopLiveStreamDialog from './StopLiveStreamDialog'; import StopLiveStreamDialog from './StopLiveStreamDialog';
import styles from './styles';
/** /**
* The type of the React {@code Component} props of * The type of the React {@code Component} props of
@ -47,6 +50,26 @@ export default class AbstractLiveStreamButton<P: Props>
label = 'dialog.startLiveStreaming'; label = 'dialog.startLiveStreaming';
toggledLabel = 'dialog.stopLiveStreaming'; toggledLabel = 'dialog.stopLiveStreaming';
/**
* Helper function to be implemented by subclasses, which returns
* a React Element to display (a beta tag) at the end of the button.
*
* @override
* @protected
* @returns {ReactElement}
*/
_getElementAfter() {
return (
<Container
className = { 'beta-tag' }
style = { styles && { ...styles.betaTag } }>
<Text style = { styles && { ...styles.betaTagText } }>
{ this.props.t('recording.beta') }
</Text>
</Container>
);
}
/** /**
* Handles clicking / pressing the button. * Handles clicking / pressing the button.
* *

View File

@ -1,6 +1,5 @@
// @flow // @flow
import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
@ -57,22 +56,6 @@ class LiveStreamButton extends AbstractLiveStreamButton<Props> {
this.tooltip = newProps._liveStreamDisabledTooltipKey; this.tooltip = newProps._liveStreamDisabledTooltipKey;
} }
/**
* Helper function to be implemented by subclasses, which returns
* a React Element to display (a beta tag) at the end of the button.
*
* @override
* @protected
* @returns {boolean}
*/
_getElementAfter() {
return (
<span className = 'beta-tag'>
{ this.props.t('recording.beta') }
</span>
);
}
/** /**
* Helper function to be implemented by subclasses, which must return a * Helper function to be implemented by subclasses, which must return a
* boolean value indicating if this button is disabled or not. * boolean value indicating if this button is disabled or not.

View File

@ -1,11 +1,24 @@
// @flow // @flow
import { BoxModel, createStyleSheet } from '../../../base/styles'; import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
/** /**
* The styles of the React {@code Components} of LiveStream. * The styles of the React {@code Components} of LiveStream.
*/ */
export default createStyleSheet({ export default createStyleSheet({
betaTag: {
backgroundColor: ColorPalette.darkGrey,
borderRadius: 2,
marginLeft: 16,
opacity: 0.90,
paddingLeft: 6,
paddingRight: 6
},
betaTagText: {
color: ColorPalette.white,
fontWeight: 'bold'
},
streamKeyFormWrapper: { streamKeyFormWrapper: {
flexDirection: 'column', flexDirection: 'column',

View File

@ -180,7 +180,7 @@ const overflowMenuStyles = createStyleSheet({
* {@code OverflowMenu}. * {@code OverflowMenu}.
*/ */
label: { label: {
flex: 1, flexShrink: 1,
fontSize: 16, fontSize: 16,
marginLeft: 32, marginLeft: 32,
opacity: 0.90 opacity: 0.90