Browse Source

fix(Labels): Recording label background color

master
Vlad Piersec 4 years ago
parent
commit
428c3cef38

+ 5
- 0
react/features/recording/components/AbstractRecordingLabel.js View File

20
      */
20
      */
21
     _status: ?string,
21
     _status: ?string,
22
 
22
 
23
+    /**
24
+     * An object containing the CSS classes.
25
+     */
26
+    classes: ?{[ key: string]: string},
27
+
23
     /**
28
     /**
24
      * The recording mode this indicator should display.
29
      * The recording mode this indicator should display.
25
      */
30
      */

+ 24
- 3
react/features/recording/components/web/RecordingLabel.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { withStyles } from '@material-ui/core/styles';
3
 import React from 'react';
4
 import React from 'react';
4
 
5
 
5
 import { translate } from '../../../base/i18n';
6
 import { translate } from '../../../base/i18n';
10
     _mapStateToProps
11
     _mapStateToProps
11
 } from '../AbstractRecordingLabel';
12
 } from '../AbstractRecordingLabel';
12
 
13
 
14
+/**
15
+ * Creates the styles for the component.
16
+ *
17
+ * @param {Object} theme - The current UI theme.
18
+ *
19
+ * @returns {Object}
20
+ */
21
+const styles = theme => {
22
+    return {
23
+        [JitsiRecordingConstants.mode.STREAM]: {
24
+            background: theme.palette.ui03
25
+        },
26
+        [JitsiRecordingConstants.mode.FILE]: {
27
+            background: theme.palette.iconError
28
+        }
29
+    };
30
+};
31
+
13
 /**
32
 /**
14
  * Implements a React {@link Component} which displays the current state of
33
  * Implements a React {@link Component} which displays the current state of
15
  * conference recording.
34
  * conference recording.
29
             return null;
48
             return null;
30
         }
49
         }
31
 
50
 
51
+        const { classes, mode, t } = this.props;
52
+
32
         return (
53
         return (
33
             <div>
54
             <div>
34
                 <Label
55
                 <Label
35
-                    className = { this.props.mode }
36
-                    text = { this.props.t(this._getLabelKey()) } />
56
+                    className = { classes && classes[mode] }
57
+                    text = { t(this._getLabelKey()) } />
37
             </div>
58
             </div>
38
         );
59
         );
39
     }
60
     }
41
     _getLabelKey: () => ?string
62
     _getLabelKey: () => ?string
42
 }
63
 }
43
 
64
 
44
-export default translate(connect(_mapStateToProps)(RecordingLabel));
65
+export default withStyles(styles)(translate(connect(_mapStateToProps)(RecordingLabel)));

Loading…
Cancel
Save