Преглед изворни кода

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

master
Calin Chitu пре 4 година
родитељ
комит
cf49af1a9f
1 измењених фајлова са 31 додато и 1 уклоњено
  1. 31
    1
      react/features/participants-pane/components/ParticipantsPaneButton.js

+ 31
- 1
react/features/participants-pane/components/ParticipantsPaneButton.js Прегледај датотеку

@@ -10,6 +10,11 @@ import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/com
10 10
  */
11 11
 type Props = AbstractButtonProps & {
12 12
 
13
+    /**
14
+     * Whether or not the participants pane is open.
15
+     */
16
+    _isOpen: boolean,
17
+
13 18
     /**
14 19
      * External handler for click action.
15 20
      */
@@ -34,6 +39,31 @@ class ParticipantsPaneButton extends AbstractButton<Props, *> {
34 39
     _handleClick() {
35 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));

Loading…
Откажи
Сачувај