Sfoglia il codice sorgente

task(rn): hide screen share button when audioOnly mode

master
tmoldovan8x8 4 anni fa
parent
commit
06110d1dfb
Nessun account collegato all'indirizzo email del committer

+ 15
- 1
react/features/toolbox/components/native/ScreenSharingAndroidButton.js Vedi File

11
  */
11
  */
12
 type Props = AbstractButtonProps & {
12
 type Props = AbstractButtonProps & {
13
 
13
 
14
+    /**
15
+     * True if the button needs to be disabled.
16
+     */
17
+    _disabled: boolean,
18
+
14
     /**
19
     /**
15
      * Whether video is currently muted or not.
20
      * Whether video is currently muted or not.
16
      */
21
      */
44
         this.props.dispatch(toggleScreensharing(enable));
49
         this.props.dispatch(toggleScreensharing(enable));
45
     }
50
     }
46
 
51
 
52
+    /**
53
+     * Returns a boolean value indicating if this button is disabled or not.
54
+     *
55
+     * @protected
56
+     * @returns {boolean}
57
+     */
58
+    _isDisabled() {
59
+        return this.props._disabled;
60
+    }
61
+
47
     /**
62
     /**
48
      * Indicates whether this button is in toggled state or not.
63
      * Indicates whether this button is in toggled state or not.
49
      *
64
      *
63
  * @param {Object} state - The Redux state.
78
  * @param {Object} state - The Redux state.
64
  * @private
79
  * @private
65
  * @returns {{
80
  * @returns {{
66
- *     _disabled: boolean,
67
  *     _screensharing: boolean
81
  *     _screensharing: boolean
68
  * }}
82
  * }}
69
  */
83
  */

+ 23
- 1
react/features/toolbox/components/native/ScreenSharingButton.js Vedi File

1
+// @flow
2
+
1
 import React from 'react';
3
 import React from 'react';
2
 import { Platform } from 'react-native';
4
 import { Platform } from 'react-native';
3
 
5
 
6
+import { connect } from '../../../base/redux';
7
+
4
 import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
8
 import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
5
 import ScreenSharingIosButton from './ScreenSharingIosButton.js';
9
 import ScreenSharingIosButton from './ScreenSharingIosButton.js';
6
 
10
 
15
     </>
19
     </>
16
 );
20
 );
17
 
21
 
18
-export default ScreenSharingButton;
22
+/**
23
+ * Maps (parts of) the redux state to the associated props for the
24
+ * {@code ScreenSharingButton} component.
25
+ *
26
+ * @param {Object} state - The Redux state.
27
+ * @private
28
+ * @returns {{
29
+ *     _disabled: boolean,
30
+ * }}
31
+ */
32
+function _mapStateToProps(state): Object {
33
+    const disabled = state['features/base/audio-only'].enabled;
34
+
35
+    return {
36
+        _disabled: disabled
37
+    };
38
+}
39
+
40
+export default connect(_mapStateToProps)(ScreenSharingButton);

+ 15
- 0
react/features/toolbox/components/native/ScreenSharingIosButton.js Vedi File

16
  */
16
  */
17
 type Props = AbstractButtonProps & {
17
 type Props = AbstractButtonProps & {
18
 
18
 
19
+    /**
20
+     * True if the button needs to be disabled.
21
+     */
22
+    _disabled: boolean,
23
+
19
     /**
24
     /**
20
      * Whether video is currently muted or not.
25
      * Whether video is currently muted or not.
21
      */
26
      */
84
       NativeModules.ScreenCapturePickerViewManager.show(handle);
89
       NativeModules.ScreenCapturePickerViewManager.show(handle);
85
   }
90
   }
86
 
91
 
92
+  /**
93
+   * Returns a boolean value indicating if this button is disabled or not.
94
+   *
95
+   * @protected
96
+   * @returns {boolean}
97
+   */
98
+  _isDisabled() {
99
+      return this.props._disabled;
100
+  }
101
+
87
   /**
102
   /**
88
    * Indicates whether this button is in toggled state or not.
103
    * Indicates whether this button is in toggled state or not.
89
    *
104
    *

Loading…
Annulla
Salva