Browse Source

UI: add a "Local Recording" label

j8
Radium Zheng 7 years ago
parent
commit
7822831b1e

+ 4
- 0
css/modals/video-quality/_video-quality.scss View File

@@ -168,6 +168,10 @@
168 168
         background: #FF5630;
169 169
     }
170 170
 
171
+    .circular-label.local-rec {
172
+        background: #FF5630;
173
+    }
174
+
171 175
     .circular-label.stream {
172 176
         background: #0065FF;
173 177
     }

+ 3
- 1
lang/main.json View File

@@ -692,6 +692,8 @@
692 692
             "notModerator": "You are not the moderator. You cannot start or stop local recording."
693 693
         },
694 694
         "yes": "Yes",
695
-        "no": "No"
695
+        "no": "No",
696
+        "label": "LOR",
697
+        "labelToolTip": "Local recording is engaged"
696 698
     }
697 699
 }

+ 13
- 0
react/features/large-video/components/AbstractLabels.js View File

@@ -3,6 +3,7 @@
3 3
 import React, { Component } from 'react';
4 4
 
5 5
 import { isFilmstripVisible } from '../../filmstrip';
6
+import { LocalRecordingLabel } from '../../local-recording';
6 7
 import { RecordingLabel } from '../../recording';
7 8
 import { VideoQualityLabel } from '../../video-quality';
8 9
 import { TranscribingLabel } from '../../transcribing/';
@@ -63,6 +64,18 @@ export default class AbstractLabels<P: Props, S> extends Component<P, S> {
63 64
             <TranscribingLabel />
64 65
         );
65 66
     }
67
+
68
+    /**
69
+     * Renders the {@code LocalRecordingLabel}.
70
+     *
71
+     * @returns {React$Element}
72
+     * @protected
73
+     */
74
+    _renderLocalRecordingLabel() {
75
+        return (
76
+            <LocalRecordingLabel />
77
+        );
78
+    }
66 79
 }
67 80
 
68 81
 /**

+ 5
- 0
react/features/large-video/components/Labels.web.js View File

@@ -85,6 +85,9 @@ class Labels extends AbstractLabels<Props, State> {
85 85
                     this._renderRecordingLabel(
86 86
                         JitsiRecordingConstants.mode.STREAM)
87 87
                 }
88
+                {
89
+                    this._renderLocalRecordingLabel()
90
+                }
88 91
                 {
89 92
                     this._renderTranscribingLabel()
90 93
                 }
@@ -100,6 +103,8 @@ class Labels extends AbstractLabels<Props, State> {
100 103
     _renderVideoQualityLabel: () => React$Element<*>
101 104
 
102 105
     _renderTranscribingLabel: () => React$Element<*>
106
+
107
+    _renderLocalRecordingLabel: () => React$Element<*>
103 108
 }
104 109
 
105 110
 export default connect(_mapStateToProps)(Labels);

+ 75
- 0
react/features/local-recording/components/LocalRecordingLabel.js View File

@@ -0,0 +1,75 @@
1
+// @flow
2
+
3
+import Tooltip from '@atlaskit/tooltip';
4
+import React, { Component } from 'react';
5
+import { connect } from 'react-redux';
6
+
7
+import { translate } from '../../base/i18n/index';
8
+import { CircularLabel } from '../../base/label/index';
9
+
10
+
11
+/**
12
+ * The type of the React {@code Component} props of {@link LocalRecordingLabel}.
13
+ */
14
+type Props = {
15
+
16
+    /**
17
+     * Invoked to obtain translated strings.
18
+     */
19
+    t: Function,
20
+
21
+    /**
22
+     * Whether local recording is engaged or not.
23
+     */
24
+    isEngaged: boolean
25
+};
26
+
27
+/**
28
+ * React Component for displaying a label when local recording is engaged.
29
+ *
30
+ * @extends Component
31
+ */
32
+class LocalRecordingLabel extends Component<Props> {
33
+
34
+    /**
35
+     * Implements React's {@link Component#render()}.
36
+     *
37
+     * @inheritdoc
38
+     * @returns {ReactElement}
39
+     */
40
+    render() {
41
+        if (!this.props.isEngaged) {
42
+            return null;
43
+        }
44
+
45
+        return (
46
+            <Tooltip
47
+                content = { this.props.t('localRecording.labelToolTip') }
48
+                position = { 'left' }>
49
+                <CircularLabel
50
+                    className = 'local-rec'
51
+                    label = { this.props.t('localRecording.label') } />
52
+            </Tooltip>
53
+        );
54
+    }
55
+
56
+}
57
+
58
+/**
59
+ * Maps (parts of) the Redux state to the associated props for the
60
+ * {@code LocalRecordingLabel} component.
61
+ *
62
+ * @param {Object} state - The Redux state.
63
+ * @private
64
+ * @returns {{
65
+ * }}
66
+ */
67
+function _mapStateToProps(state) {
68
+    const { isEngaged } = state['features/local-recording'];
69
+
70
+    return {
71
+        isEngaged
72
+    };
73
+}
74
+
75
+export default translate(connect(_mapStateToProps)(LocalRecordingLabel));

+ 1
- 0
react/features/local-recording/components/index.js View File

@@ -1,4 +1,5 @@
1 1
 export { default as LocalRecordingButton } from './LocalRecordingButton';
2
+export { default as LocalRecordingLabel } from './LocalRecordingLabel';
2 3
 export {
3 4
     default as LocalRecordingInfoDialog
4 5
 } from './LocalRecordingInfoDialog';

Loading…
Cancel
Save