Sfoglia il codice sorgente

[RN] Add ability to enable / disable the filmstrip (Coding style: comments, naming)

master
Lyubo Marinov 7 anni fa
parent
commit
240fff74c7

+ 2
- 2
react/features/conference/components/Conference.native.js Vedi File

355
 }
355
 }
356
 
356
 
357
 /**
357
 /**
358
- * Maps (parts of) the Redux state to the associated Conference's props.
358
+ * Maps (parts of) the redux state to the associated {@code Conference}'s props.
359
  *
359
  *
360
- * @param {Object} state - The Redux state.
360
+ * @param {Object} state - The redux state.
361
  * @private
361
  * @private
362
  * @returns {{
362
  * @returns {{
363
  *     _connecting: boolean,
363
  *     _connecting: boolean,

+ 9
- 9
react/features/conference/components/Conference.web.js Vedi File

25
 type Props = {
25
 type Props = {
26
 
26
 
27
     /**
27
     /**
28
-     * Whether or not the current local user is recording the conference.
28
+     * Whether the local participant is recording the conference.
29
      */
29
      */
30
-    _isRecording: boolean,
30
+    _iAmRecorder: boolean,
31
 
31
 
32
     dispatch: Function,
32
     dispatch: Function,
33
     t: Function
33
     t: Function
102
      */
102
      */
103
     render() {
103
     render() {
104
         const { filmStripOnly, VIDEO_QUALITY_LABEL_DISABLED } = interfaceConfig;
104
         const { filmStripOnly, VIDEO_QUALITY_LABEL_DISABLED } = interfaceConfig;
105
-        const hideVideoQualityLabel = filmStripOnly
106
-            || VIDEO_QUALITY_LABEL_DISABLED
107
-            || this.props._isRecording;
105
+        const hideVideoQualityLabel
106
+            = filmStripOnly
107
+                || VIDEO_QUALITY_LABEL_DISABLED
108
+                || this.props._iAmRecorder;
108
 
109
 
109
         return (
110
         return (
110
             <div
111
             <div
153
  * @param {Object} state - The Redux state.
154
  * @param {Object} state - The Redux state.
154
  * @private
155
  * @private
155
  * @returns {{
156
  * @returns {{
156
- *     _isRecording: boolean
157
+ *     _iAmRecorder: boolean
157
  * }}
158
  * }}
158
  */
159
  */
159
 function _mapStateToProps(state) {
160
 function _mapStateToProps(state) {
160
     return {
161
     return {
161
         /**
162
         /**
162
-         * Indicates if the current user is recording the conference, ie, they
163
-         * are a recorder.
163
+         * Whether the local participant is recording the conference.
164
          *
164
          *
165
          * @private
165
          * @private
166
          */
166
          */
167
-        _isRecording: state['features/base/config'].iAmRecorder
167
+        _iAmRecorder: state['features/base/config'].iAmRecorder
168
     };
168
     };
169
 }
169
 }
170
 
170
 

+ 2
- 3
react/features/filmstrip/actionTypes.js Vedi File

1
 /**
1
 /**
2
- * The type of (redux) action which sets whether the filmstrip is enabled or
3
- * not.
2
+ * The type of (redux) action which sets whether the filmstrip is enabled.
4
  *
3
  *
5
  * {
4
  * {
6
  *     type: SET_FILMSTRIP_ENABLED,
5
  *     type: SET_FILMSTRIP_ENABLED,
21
 export const SET_FILMSTRIP_HOVERED = Symbol('SET_FILMSTRIP_HOVERED');
20
 export const SET_FILMSTRIP_HOVERED = Symbol('SET_FILMSTRIP_HOVERED');
22
 
21
 
23
 /**
22
 /**
24
- * The type of (redux) action which sets the visibility of the filmstrip.
23
+ * The type of (redux) action which sets whether the filmstrip is visible.
25
  *
24
  *
26
  * {
25
  * {
27
  *     type: SET_FILMSTRIP_VISIBLE,
26
  *     type: SET_FILMSTRIP_VISIBLE,

+ 11
- 10
react/features/filmstrip/actions.js Vedi File

1
+// @flow
2
+
1
 import {
3
 import {
2
     SET_FILMSTRIP_ENABLED,
4
     SET_FILMSTRIP_ENABLED,
3
     SET_FILMSTRIP_HOVERED,
5
     SET_FILMSTRIP_HOVERED,
5
 } from './actionTypes';
7
 } from './actionTypes';
6
 
8
 
7
 /**
9
 /**
8
- * Sets if the filmstrip should be enabled.
10
+ * Sets whether the filmstrip is enabled.
9
  *
11
  *
10
- * @param {boolean} enabled - Whether the filmstrip should be enabled.
12
+ * @param {boolean} enabled - Whether the filmstrip is enabled.
11
  * @returns {{
13
  * @returns {{
12
  *     type: SET_FILMSTRIP_ENABLED,
14
  *     type: SET_FILMSTRIP_ENABLED,
13
  *     enabled: boolean
15
  *     enabled: boolean
14
  * }}
16
  * }}
15
  */
17
  */
16
-export function setFilmstripEnabled(enabled) {
18
+export function setFilmstripEnabled(enabled: boolean) {
17
     return {
19
     return {
18
         type: SET_FILMSTRIP_ENABLED,
20
         type: SET_FILMSTRIP_ENABLED,
19
         enabled
21
         enabled
21
 }
23
 }
22
 
24
 
23
 /**
25
 /**
24
- * Sets if the filmstrip is currently being hovered over.
26
+ * Sets whether the filmstrip is being hovered (over).
25
  *
27
  *
26
- * @param {boolean} hovered - Whether or not the filmstrip is currently being
27
- * hovered over.
28
+ * @param {boolean} hovered - Whether the filmstrip is being hovered (over).
28
  * @returns {{
29
  * @returns {{
29
  *     type: SET_FILMSTRIP_HOVERED,
30
  *     type: SET_FILMSTRIP_HOVERED,
30
  *     hovered: boolean
31
  *     hovered: boolean
31
  * }}
32
  * }}
32
  */
33
  */
33
-export function setFilmstripHovered(hovered) {
34
+export function setFilmstripHovered(hovered: boolean) {
34
     return {
35
     return {
35
         type: SET_FILMSTRIP_HOVERED,
36
         type: SET_FILMSTRIP_HOVERED,
36
         hovered
37
         hovered
38
 }
39
 }
39
 
40
 
40
 /**
41
 /**
41
- * Sets if the filmstrip should be visible.
42
+ * Sets whether the filmstrip is visible.
42
  *
43
  *
43
- * @param {boolean} visible - Whether the filmstrip should be visible.
44
+ * @param {boolean} visible - Whether the filmstrip is visible.
44
  * @returns {{
45
  * @returns {{
45
  *     type: SET_FILMSTRIP_VISIBLE,
46
  *     type: SET_FILMSTRIP_VISIBLE,
46
  *     visible: boolean
47
  *     visible: boolean
47
  * }}
48
  * }}
48
  */
49
  */
49
-export function setFilmstripVisible(visible) {
50
+export function setFilmstripVisible(visible: boolean) {
50
     return {
51
     return {
51
         type: SET_FILMSTRIP_VISIBLE,
52
         type: SET_FILMSTRIP_VISIBLE,
52
         visible
53
         visible

+ 7
- 8
react/features/filmstrip/components/Filmstrip.native.js Vedi File

10
     makeAspectRatioAware
10
     makeAspectRatioAware
11
 } from '../../base/responsive-ui';
11
 } from '../../base/responsive-ui';
12
 
12
 
13
-import { styles } from './_';
13
+import styles from './styles';
14
 import Thumbnail from './Thumbnail';
14
 import Thumbnail from './Thumbnail';
15
 
15
 
16
 /**
16
 /**
63
             = isNarrowAspectRatio_
63
             = isNarrowAspectRatio_
64
                 ? styles.filmstripNarrow
64
                 ? styles.filmstripNarrow
65
                 : styles.filmstripWide;
65
                 : styles.filmstripWide;
66
-        const {
67
-            _participants: participants,
68
-            _visible: visible } = this.props;
69
 
66
 
70
         return (
67
         return (
71
             <Container
68
             <Container
72
                 style = { filmstripStyle }
69
                 style = { filmstripStyle }
73
-                visible = { visible }>
70
+                visible = { this.props._visible }>
74
                 <ScrollView
71
                 <ScrollView
75
                     horizontal = { isNarrowAspectRatio_ }
72
                     horizontal = { isNarrowAspectRatio_ }
76
                     showsHorizontalScrollIndicator = { false }
73
                     showsHorizontalScrollIndicator = { false }
78
                     {
75
                     {
79
                         /* eslint-disable react/jsx-wrap-multilines */
76
                         /* eslint-disable react/jsx-wrap-multilines */
80
 
77
 
81
-                        this._sort(participants, isNarrowAspectRatio_)
78
+                        this._sort(
79
+                                this.props._participants,
80
+                                isNarrowAspectRatio_)
82
                             .map(p =>
81
                             .map(p =>
83
                                 <Thumbnail
82
                                 <Thumbnail
84
                                     key = { p.id }
83
                                     key = { p.id }
127
 }
126
 }
128
 
127
 
129
 /**
128
 /**
130
- * Function that maps parts of Redux state tree into component props.
129
+ * Maps (parts of) the redux state to the associated {@code Filmstrip}'s props.
131
  *
130
  *
132
- * @param {Object} state - Redux state.
131
+ * @param {Object} state - The redux state.
133
  * @private
132
  * @private
134
  * @returns {{
133
  * @returns {{
135
  *     _participants: Participant[],
134
  *     _participants: Participant[],

+ 23
- 0
react/features/filmstrip/reducer.js Vedi File

1
+// @flow
2
+
1
 import { ReducerRegistry } from '../base/redux';
3
 import { ReducerRegistry } from '../base/redux';
2
 
4
 
3
 import {
5
 import {
7
 } from './actionTypes';
9
 } from './actionTypes';
8
 
10
 
9
 const DEFAULT_STATE = {
11
 const DEFAULT_STATE = {
12
+    /**
13
+     * The indicator which determines whether the {@link Filmstrip} is enabled.
14
+     *
15
+     * @public
16
+     * @type {boolean}
17
+     */
10
     enabled: true,
18
     enabled: true,
19
+
20
+    /**
21
+     * The indicator which determines whether the {@link Filmstrip} is visible.
22
+     *
23
+     * @public
24
+     * @type {boolean}
25
+     */
11
     visible: true
26
     visible: true
12
 };
27
 };
13
 
28
 
24
         case SET_FILMSTRIP_HOVERED:
39
         case SET_FILMSTRIP_HOVERED:
25
             return {
40
             return {
26
                 ...state,
41
                 ...state,
42
+
43
+                /**
44
+                 * The indicator which determines whether the {@link Filmstrip}
45
+                 * is being hovered (over).
46
+                 *
47
+                 * @public
48
+                 * @type {boolean}
49
+                 */
27
                 hovered: action.hovered
50
                 hovered: action.hovered
28
             };
51
             };
29
 
52
 

Loading…
Annulla
Salva