Ver código fonte

fix(participants-pane) fixed participants pane button toggled state

master
Calin Chitu 4 anos atrás
pai
commit
cf49af1a9f

+ 31
- 1
react/features/participants-pane/components/ParticipantsPaneButton.js Ver arquivo

10
  */
10
  */
11
 type Props = AbstractButtonProps & {
11
 type Props = AbstractButtonProps & {
12
 
12
 
13
+    /**
14
+     * Whether or not the participants pane is open.
15
+     */
16
+    _isOpen: boolean,
17
+
13
     /**
18
     /**
14
      * External handler for click action.
19
      * External handler for click action.
15
      */
20
      */
34
     _handleClick() {
39
     _handleClick() {
35
         this.props.handleClick();
40
         this.props.handleClick();
36
     }
41
     }
42
+
43
+    /**
44
+     * Indicates whether this button is in toggled state or not.
45
+     *
46
+     * @override
47
+     * @protected
48
+     * @returns {boolean}
49
+     */
50
+    _isToggled() {
51
+        return this.props._isOpen;
52
+    }
53
+}
54
+
55
+/**
56
+ * Maps part of the Redux state to the props of this component.
57
+ *
58
+ * @param {Object} state - The Redux state.
59
+ * @returns {Props}
60
+ */
61
+function mapStateToProps(state) {
62
+    const { isOpen } = state['features/participants-pane'];
63
+
64
+    return {
65
+        _isOpen: isOpen
66
+    };
37
 }
67
 }
38
 
68
 
39
-export default translate(connect()(ParticipantsPaneButton));
69
+export default translate(connect(mapStateToProps)(ParticipantsPaneButton));

Carregando…
Cancelar
Salvar