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
     _renderItem() {
51
     _renderItem() {
52
         const {
52
         const {
53
             disabled,
53
             disabled,
54
+            elementAfter,
54
             onClick,
55
             onClick,
55
             showLabel,
56
             showLabel,
56
             styles
57
             styles
72
                     <Text style = { styles && styles.labelStyle }>
73
                     <Text style = { styles && styles.labelStyle }>
73
                         { this.label }
74
                         { this.label }
74
                     </Text>
75
                     </Text>
76
+                    { elementAfter }
75
                 </View>
77
                 </View>
76
             );
78
             );
77
 
79
 

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

1
 // @flow
1
 // @flow
2
 
2
 
3
+import React from 'react';
3
 import { openDialog } from '../../../base/dialog';
4
 import { openDialog } from '../../../base/dialog';
4
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
5
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
5
 import {
6
 import {
6
     isLocalParticipantModerator,
7
     isLocalParticipantModerator,
7
     getLocalParticipant
8
     getLocalParticipant
8
 } from '../../../base/participants';
9
 } from '../../../base/participants';
10
+import { Container, Text } from '../../../base/react';
9
 import {
11
 import {
10
     AbstractButton,
12
     AbstractButton,
11
     type AbstractButtonProps
13
     type AbstractButtonProps
15
 
17
 
16
 import StartLiveStreamDialog from './StartLiveStreamDialog';
18
 import StartLiveStreamDialog from './StartLiveStreamDialog';
17
 import StopLiveStreamDialog from './StopLiveStreamDialog';
19
 import StopLiveStreamDialog from './StopLiveStreamDialog';
20
+import styles from './styles';
18
 
21
 
19
 /**
22
 /**
20
  * The type of the React {@code Component} props of
23
  * The type of the React {@code Component} props of
47
     label = 'dialog.startLiveStreaming';
50
     label = 'dialog.startLiveStreaming';
48
     toggledLabel = 'dialog.stopLiveStreaming';
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
      * Handles clicking / pressing the button.
74
      * Handles clicking / pressing the button.
52
      *
75
      *

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

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React from 'react';
4
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
5
 
4
 
6
 import { translate } from '../../../base/i18n';
5
 import { translate } from '../../../base/i18n';
57
         this.tooltip = newProps._liveStreamDisabledTooltipKey;
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
      * Helper function to be implemented by subclasses, which must return a
60
      * Helper function to be implemented by subclasses, which must return a
78
      * boolean value indicating if this button is disabled or not.
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
 // @flow
1
 // @flow
2
 
2
 
3
-import { BoxModel, createStyleSheet } from '../../../base/styles';
3
+import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
4
 
4
 
5
 /**
5
 /**
6
  * The styles of the React {@code Components} of LiveStream.
6
  * The styles of the React {@code Components} of LiveStream.
7
  */
7
  */
8
 export default createStyleSheet({
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
     streamKeyFormWrapper: {
23
     streamKeyFormWrapper: {
11
         flexDirection: 'column',
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
      * {@code OverflowMenu}.
180
      * {@code OverflowMenu}.
181
      */
181
      */
182
     label: {
182
     label: {
183
-        flex: 1,
183
+        flexShrink: 1,
184
         fontSize: 16,
184
         fontSize: 16,
185
         marginLeft: 32,
185
         marginLeft: 32,
186
         opacity: 0.90
186
         opacity: 0.90

Loading…
Cancel
Save