瀏覽代碼

fix(ui) change streaming icon background + add tooltip (#12973)

factor2
Mihaela Dumitru 2 年之前
父節點
當前提交
4f95c45e50
No account linked to committer's email address

+ 3
- 1
lang/main.json 查看文件

@@ -1295,9 +1295,11 @@
1295 1295
         "ldTooltip": "Viewing low definition video",
1296 1296
         "lowDefinition": "Low definition",
1297 1297
         "performanceSettings": "Performance settings",
1298
+        "recording": "Recording in progress",
1298 1299
         "sd": "SD",
1299 1300
         "sdTooltip": "Viewing standard definition video",
1300
-        "standardDefinition": "Standard definition"
1301
+        "standardDefinition": "Standard definition",
1302
+        "streaming": "Streaming in progress"
1301 1303
     },
1302 1304
     "videothumbnail": {
1303 1305
         "connectionInfo": "Connection Info",

+ 1
- 21
react/features/recording/components/native/RecordingLabel.js 查看文件

@@ -26,26 +26,6 @@ class RecordingLabel extends AbstractRecordingLabel {
26 26
      * @inheritdoc
27 27
      */
28 28
     _renderLabel() {
29
-        let indicatorStyle = styles.indicatorStyle;
30
-
31
-        switch (this.props.mode) {
32
-        case JitsiRecordingConstants.mode.STREAM:
33
-            indicatorStyle = {
34
-                ...indicatorStyle,
35
-                ...styles.indicatorLive
36
-            };
37
-            break;
38
-        case JitsiRecordingConstants.mode.FILE:
39
-            indicatorStyle = {
40
-                ...indicatorStyle,
41
-                ...styles.indicatorRecording
42
-            };
43
-            break;
44
-        default:
45
-            // Invalid mode is passed to the component.
46
-            return null;
47
-        }
48
-
49 29
         let status = 'on';
50 30
 
51 31
         switch (this.props._status) {
@@ -60,7 +40,7 @@ class RecordingLabel extends AbstractRecordingLabel {
60 40
         return (
61 41
             <Label
62 42
                 status = { status }
63
-                style = { indicatorStyle }
43
+                style = { styles.indicatorStyle }
64 44
                 text = { this.props.t(this._getLabelKey()) } />
65 45
         );
66 46
     }

+ 2
- 17
react/features/recording/components/native/styles.js 查看文件

@@ -1,10 +1,8 @@
1 1
 // @flow
2 2
 
3
-import { ColorPalette, createStyleSheet } from '../../../base/styles';
3
+import { createStyleSheet } from '../../../base/styles';
4 4
 import BaseTheme from '../../../base/ui/components/BaseTheme';
5 5
 
6
-export const LIVE_LABEL_COLOR = ColorPalette.blue;
7
-
8 6
 /**
9 7
  * The styles of the React {@code Components} of the feature recording.
10 8
  */
@@ -16,20 +14,7 @@ export default createStyleSheet({
16 14
     indicatorStyle: {
17 15
         marginRight: 4,
18 16
         marginLeft: 0,
19
-        marginBottom: 0
20
-    },
21
-
22
-    /**
23
-     * Style for the recording indicator.
24
-     */
25
-    indicatorLive: {
26
-        backgroundColor: LIVE_LABEL_COLOR
27
-    },
28
-
29
-    /**
30
-     * Style for the recording indicator.
31
-     */
32
-    indicatorRecording: {
17
+        marginBottom: 0,
33 18
         backgroundColor: BaseTheme.palette.iconError
34 19
     }
35 20
 });

+ 14
- 9
react/features/recording/components/web/RecordingLabel.tsx 查看文件

@@ -7,6 +7,9 @@ import { IconRecord, IconSites } from '../../../base/icons/svg';
7 7
 import Label from '../../../base/label/components/web/Label';
8 8
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9 9
 import { connect } from '../../../base/redux/functions';
10
+// eslint-disable-next-line lines-around-comment
11
+// @ts-ignore
12
+import { Tooltip } from '../../../base/tooltip';
10 13
 import AbstractRecordingLabel, {
11 14
     _mapStateToProps
12 15
 
@@ -22,10 +25,7 @@ import AbstractRecordingLabel, {
22 25
  */
23 26
 const styles = (theme: Theme) => {
24 27
     return {
25
-        [JitsiRecordingConstants.mode.STREAM]: {
26
-            background: theme.palette.support07
27
-        },
28
-        [JitsiRecordingConstants.mode.FILE]: {
28
+        record: {
29 29
             background: theme.palette.actionDanger
30 30
         }
31 31
     };
@@ -52,14 +52,19 @@ class RecordingLabel extends AbstractRecordingLabel {
52 52
         }
53 53
 
54 54
         // @ts-ignore
55
-        const { classes, mode } = this.props;
55
+        const { classes, mode, t } = this.props;
56
+        const isRecording = mode === JitsiRecordingConstants.mode.FILE;
57
+        const icon = isRecording ? IconRecord : IconSites;
58
+        const content = t(isRecording ? 'videoStatus.recording' : 'videoStatus.streaming');
56 59
 
57 60
         return (
58
-            <div>
61
+            <Tooltip
62
+                content = { content }
63
+                position = { 'bottom' }>
59 64
                 <Label
60
-                    className = { classes?.[mode] }
61
-                    icon = { mode === JitsiRecordingConstants.mode.FILE ? IconRecord : IconSites } />
62
-            </div>
65
+                    className = { classes?.record }
66
+                    icon = { icon } />
67
+            </Tooltip>
63 68
         );
64 69
     }
65 70
 }

Loading…
取消
儲存