Browse Source

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

master
Leonard Kim 7 years ago
parent
commit
f97f294d1a

+ 2
- 0
react/features/base/toolbox/components/ToolboxItem.native.js View File

@@ -51,6 +51,7 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
51 51
     _renderItem() {
52 52
         const {
53 53
             disabled,
54
+            elementAfter,
54 55
             onClick,
55 56
             showLabel,
56 57
             styles
@@ -72,6 +73,7 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
72 73
                     <Text style = { styles && styles.labelStyle }>
73 74
                         { this.label }
74 75
                     </Text>
76
+                    { elementAfter }
75 77
                 </View>
76 78
             );
77 79
 

+ 23
- 0
react/features/recording/components/LiveStream/AbstractLiveStreamButton.js View File

@@ -1,11 +1,13 @@
1 1
 // @flow
2 2
 
3
+import React from 'react';
3 4
 import { openDialog } from '../../../base/dialog';
4 5
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
5 6
 import {
6 7
     isLocalParticipantModerator,
7 8
     getLocalParticipant
8 9
 } from '../../../base/participants';
10
+import { Container, Text } from '../../../base/react';
9 11
 import {
10 12
     AbstractButton,
11 13
     type AbstractButtonProps
@@ -15,6 +17,7 @@ import { getActiveSession } from '../../functions';
15 17
 
16 18
 import StartLiveStreamDialog from './StartLiveStreamDialog';
17 19
 import StopLiveStreamDialog from './StopLiveStreamDialog';
20
+import styles from './styles';
18 21
 
19 22
 /**
20 23
  * The type of the React {@code Component} props of
@@ -47,6 +50,26 @@ export default class AbstractLiveStreamButton<P: Props>
47 50
     label = 'dialog.startLiveStreaming';
48 51
     toggledLabel = 'dialog.stopLiveStreaming';
49 52
 
53
+    /**
54
+     * Helper function to be implemented by subclasses, which returns
55
+     * a React Element to display (a beta tag) at the end of the button.
56
+     *
57
+     * @override
58
+     * @protected
59
+     * @returns {ReactElement}
60
+     */
61
+    _getElementAfter() {
62
+        return (
63
+            <Container
64
+                className = { 'beta-tag' }
65
+                style = { styles && { ...styles.betaTag } }>
66
+                <Text style = { styles && { ...styles.betaTagText } }>
67
+                    { this.props.t('recording.beta') }
68
+                </Text>
69
+            </Container>
70
+        );
71
+    }
72
+
50 73
     /**
51 74
      * Handles clicking / pressing the button.
52 75
      *

+ 0
- 17
react/features/recording/components/LiveStream/LiveStreamButton.web.js View File

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import React from 'react';
4 3
 import { connect } from 'react-redux';
5 4
 
6 5
 import { translate } from '../../../base/i18n';
@@ -57,22 +56,6 @@ class LiveStreamButton extends AbstractLiveStreamButton<Props> {
57 56
         this.tooltip = newProps._liveStreamDisabledTooltipKey;
58 57
     }
59 58
 
60
-    /**
61
-     * Helper function to be implemented by subclasses, which returns
62
-     * a React Element to display (a beta tag) at the end of the button.
63
-     *
64
-     * @override
65
-     * @protected
66
-     * @returns {boolean}
67
-     */
68
-    _getElementAfter() {
69
-        return (
70
-            <span className = 'beta-tag'>
71
-                { this.props.t('recording.beta') }
72
-            </span>
73
-        );
74
-    }
75
-
76 59
     /**
77 60
      * Helper function to be implemented by subclasses, which must return a
78 61
      * boolean value indicating if this button is disabled or not.

react/features/recording/components/LiveStream/styles.js → react/features/recording/components/LiveStream/styles.native.js View File

@@ -1,11 +1,24 @@
1 1
 // @flow
2 2
 
3
-import { BoxModel, createStyleSheet } from '../../../base/styles';
3
+import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
4 4
 
5 5
 /**
6 6
  * The styles of the React {@code Components} of LiveStream.
7 7
  */
8 8
 export default createStyleSheet({
9
+    betaTag: {
10
+        backgroundColor: ColorPalette.darkGrey,
11
+        borderRadius: 2,
12
+        marginLeft: 16,
13
+        opacity: 0.90,
14
+        paddingLeft: 6,
15
+        paddingRight: 6
16
+    },
17
+
18
+    betaTagText: {
19
+        color: ColorPalette.white,
20
+        fontWeight: 'bold'
21
+    },
9 22
 
10 23
     streamKeyFormWrapper: {
11 24
         flexDirection: 'column',

+ 0
- 0
react/features/recording/components/LiveStream/styles.web.js View File


+ 1
- 1
react/features/toolbox/components/native/styles.js View File

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

Loading…
Cancel
Save