浏览代码

React propTypes as static class properties

j8
Lyubomir Marinov 8 年前
父节点
当前提交
0db33bb45c
共有 24 个文件被更改,包括 352 次插入357 次删除
  1. 1
    0
      package.json
  2. 1
    0
      react/.eslintrc.js
  3. 15
    15
      react/features/app/components/AbstractApp.js
  4. 7
    7
      react/features/app/components/App.native.js
  5. 7
    7
      react/features/app/components/App.web.js
  6. 18
    18
      react/features/base/media/components/AbstractVideoTrack.js
  7. 10
    10
      react/features/base/media/components/native/Audio.js
  8. 37
    37
      react/features/base/media/components/native/Video.js
  9. 7
    7
      react/features/base/media/components/native/VideoTrack.js
  10. 34
    34
      react/features/base/react/components/AbstractContainer.js
  11. 6
    7
      react/features/base/react/components/Container.native.js
  12. 27
    25
      react/features/base/react/components/Link.native.js
  13. 14
    15
      react/features/conference/components/Avatar.native.js
  14. 8
    9
      react/features/conference/components/Conference.native.js
  15. 57
    59
      react/features/conference/components/ParticipantView.native.js
  16. 10
    10
      react/features/filmStrip/components/FilmStrip.js
  17. 13
    13
      react/features/filmStrip/components/Thumbnail.js
  18. 14
    15
      react/features/largeVideo/components/LargeVideo.js
  19. 12
    12
      react/features/toolbar/components/AbstractToolbar.js
  20. 23
    25
      react/features/toolbar/components/AbstractToolbarButton.js
  21. 7
    7
      react/features/toolbar/components/Toolbar.native.js
  22. 6
    7
      react/features/toolbar/components/ToolbarButton.native.js
  23. 11
    11
      react/features/welcome/components/AbstractWelcomePage.js
  24. 7
    7
      react/features/welcome/components/WelcomePage.native.js

+ 1
- 0
package.json 查看文件

@@ -52,6 +52,7 @@
52 52
   },
53 53
   "devDependencies": {
54 54
     "babel-core": "*",
55
+    "babel-eslint": "^7.1.1",
55 56
     "babel-loader": "^6.2.8",
56 57
     "babel-polyfill": "*",
57 58
     "babel-preset-es2015": "^6.18.0",

+ 1
- 0
react/.eslintrc.js 查看文件

@@ -4,6 +4,7 @@ module.exports = {
4 4
         'commonjs': true,
5 5
         'es6': true
6 6
     },
7
+    'parser': 'babel-eslint',
7 8
     'parserOptions': {
8 9
         'ecmaFeatures': {
9 10
             'experimentalObjectRestSpread': true,

+ 15
- 15
react/features/app/components/AbstractApp.js 查看文件

@@ -29,6 +29,21 @@ const DEFAULT_CONFIG = {
29 29
  * @abstract
30 30
  */
31 31
 export class AbstractApp extends Component {
32
+    /**
33
+     * AbstractApp component's property types.
34
+     *
35
+     * @static
36
+     */
37
+    static propTypes = {
38
+        config: React.PropTypes.object,
39
+        store: React.PropTypes.object,
40
+
41
+        /**
42
+         * The URL, if any, with which the app was launched.
43
+         */
44
+        url: React.PropTypes.string
45
+    }
46
+
32 47
     /**
33 48
      * Init lib-jitsi-meet and create local participant when component is going
34 49
      * to be mounted.
@@ -113,18 +128,3 @@ export class AbstractApp extends Component {
113 128
         this.props.store.dispatch(appNavigate(url));
114 129
     }
115 130
 }
116
-
117
-/**
118
- * AbstractApp component's property types.
119
- *
120
- * @static
121
- */
122
-AbstractApp.propTypes = {
123
-    config: React.PropTypes.object,
124
-    store: React.PropTypes.object,
125
-
126
-    /**
127
-     * The URL, if any, with which the app was launched.
128
-     */
129
-    url: React.PropTypes.string
130
-};

+ 7
- 7
react/features/app/components/App.native.js 查看文件

@@ -11,6 +11,13 @@ import { AbstractApp } from './AbstractApp';
11 11
  * @extends AbstractApp
12 12
  */
13 13
 export class App extends AbstractApp {
14
+    /**
15
+     * App component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = AbstractApp.propTypes
20
+
14 21
     /**
15 22
      * Initializes a new App instance.
16 23
      *
@@ -126,10 +133,3 @@ export class App extends AbstractApp {
126 133
         this._openURL(event.url);
127 134
     }
128 135
 }
129
-
130
-/**
131
- * App component's property types.
132
- *
133
- * @static
134
- */
135
-App.propTypes = AbstractApp.propTypes;

+ 7
- 7
react/features/app/components/App.web.js 查看文件

@@ -18,6 +18,13 @@ import { AbstractApp } from './AbstractApp';
18 18
  * @extends AbstractApp
19 19
  */
20 20
 export class App extends AbstractApp {
21
+    /**
22
+     * App component's property types.
23
+     *
24
+     * @static
25
+     */
26
+    static propTypes = AbstractApp.propTypes
27
+
21 28
     /**
22 29
      * Initializes a new App instance.
23 30
      *
@@ -148,10 +155,3 @@ export class App extends AbstractApp {
148 155
         return this._createElement(component, props);
149 156
     }
150 157
 }
151
-
152
-/**
153
- * App component's property types.
154
- *
155
- * @static
156
- */
157
-App.propTypes = AbstractApp.propTypes;

+ 18
- 18
react/features/base/media/components/AbstractVideoTrack.js 查看文件

@@ -11,6 +11,24 @@ import { Video } from './_';
11 11
  * @abstract
12 12
  */
13 13
 export class AbstractVideoTrack extends Component {
14
+    /**
15
+     * AbstractVideoTrack component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = {
20
+        dispatch: React.PropTypes.func,
21
+        videoTrack: React.PropTypes.object,
22
+        waitForVideoStarted: React.PropTypes.bool,
23
+
24
+        /**
25
+         * The z-order of the Video of AbstractVideoTrack in the stacking space
26
+         * of all Videos. For more details, refer to the zOrder property of the
27
+         * Video class for React Native.
28
+         */
29
+        zOrder: React.PropTypes.number
30
+    }
31
+
14 32
     /**
15 33
      * Initializes a new AbstractVideoTrack instance.
16 34
      *
@@ -116,24 +134,6 @@ export class AbstractVideoTrack extends Component {
116 134
     }
117 135
 }
118 136
 
119
-/**
120
- * AbstractVideoTrack component's property types.
121
- *
122
- * @static
123
- */
124
-AbstractVideoTrack.propTypes = {
125
-    dispatch: React.PropTypes.func,
126
-    videoTrack: React.PropTypes.object,
127
-    waitForVideoStarted: React.PropTypes.bool,
128
-
129
-    /**
130
-     * The z-order of the Video of AbstractVideoTrack in the stacking space of
131
-     * all Videos. For more details, refer to the zOrder property of the Video
132
-     * class for React Native.
133
-     */
134
-    zOrder: React.PropTypes.number
135
-};
136
-
137 137
 /**
138 138
  * Returns null if a specific value is falsy; otherwise, returns the specified
139 139
  * value.

+ 10
- 10
react/features/base/media/components/native/Audio.js 查看文件

@@ -5,6 +5,16 @@ import React, { Component } from 'react';
5 5
  * around react-native-webrtc's RTCView.
6 6
  */
7 7
 export class Audio extends Component {
8
+    /**
9
+     * Audio component's property types.
10
+     *
11
+     * @static
12
+     */
13
+    static propTypes = {
14
+        muted: React.PropTypes.bool,
15
+        stream: React.PropTypes.object
16
+    }
17
+
8 18
     /**
9 19
      * Implements React's {@link Component#render()}.
10 20
      *
@@ -18,13 +28,3 @@ export class Audio extends Component {
18 28
         return null;
19 29
     }
20 30
 }
21
-
22
-/**
23
- * Audio component's property types.
24
- *
25
- * @static
26
- */
27
-Audio.propTypes = {
28
-    muted: React.PropTypes.bool,
29
-    stream: React.PropTypes.object
30
-};

+ 37
- 37
react/features/base/media/components/native/Video.js 查看文件

@@ -18,6 +18,43 @@ const RTCVIEW_SUPPORTS_MIRROR = Platform.OS === 'android';
18 18
  * around react-native-webrtc's RTCView.
19 19
  */
20 20
 export class Video extends Component {
21
+    /**
22
+     * Video component's property types.
23
+     *
24
+     * @static
25
+     */
26
+    static propTypes = {
27
+        mirror: React.PropTypes.bool,
28
+        muted: React.PropTypes.bool,
29
+        onPlaying: React.PropTypes.func,
30
+        stream: React.PropTypes.object,
31
+
32
+        /**
33
+         * Similarly to the CSS property z-index, specifies the z-order of this
34
+         * Video in the stacking space of all Videos. When Videos overlap,
35
+         * zOrder determines which one covers the other. A Video with a larger
36
+         * zOrder generally covers a Video with a lower one.
37
+         *
38
+         * Non-overlapping Videos may safely share a z-order (because one does
39
+         * not have to cover the other).
40
+         *
41
+         * The support for zOrder is platform-dependent and/or
42
+         * implementation-specific. Thus, specifying a value for zOrder is to be
43
+         * thought of as giving a hint rather than as imposing a requirement.
44
+         * For example, video renderers such as Video are commonly implemented
45
+         * using OpenGL and OpenGL views may have different numbers of layers in
46
+         * their stacking space. Android has three: a layer bellow the window
47
+         * (aka default), a layer bellow the window again but above the previous
48
+         * layer (aka media overlay), and above the window. Consequently, it is
49
+         * advisable to limit the number of utilized layers in the stacking
50
+         * space to the minimum sufficient for the desired display. For example,
51
+         * a video call application usually needs a maximum of two zOrder
52
+         * values: 0 for the remote video(s) which appear in the background, and
53
+         * 1 for the local video(s) which appear above the remote video(s).
54
+         */
55
+        zOrder: React.PropTypes.number
56
+    }
57
+
21 58
     /**
22 59
      * React Component method that executes once component is mounted.
23 60
      *
@@ -86,40 +123,3 @@ export class Video extends Component {
86 123
         return null;
87 124
     }
88 125
 }
89
-
90
-/**
91
- * Video component's property types.
92
- *
93
- * @static
94
- */
95
-Video.propTypes = {
96
-    mirror: React.PropTypes.bool,
97
-    muted: React.PropTypes.bool,
98
-    onPlaying: React.PropTypes.func,
99
-    stream: React.PropTypes.object,
100
-
101
-    /**
102
-     * Similarly to the CSS property z-index, specifies the z-order of this
103
-     * Video in the stacking space of all Videos. When Videos overlap, zOrder
104
-     * determines which one covers the other. A Video with a larger zOrder
105
-     * generally covers a Video with a lower one.
106
-     *
107
-     * Non-overlapping Videos may safely share a z-order (because one does not
108
-     * have to cover the other).
109
-     *
110
-     * The support for zOrder is platform-dependent and/or
111
-     * implementation-specific. Thus, specifying a value for zOrder is to be
112
-     * thought of as giving a hint rather than as imposing a requirement. For
113
-     * example, video renderers such as Video are commonly implemented using
114
-     * OpenGL and OpenGL views may have different numbers of layers in their
115
-     * stacking space. Android has three: a layer bellow the window (aka
116
-     * default), a layer bellow the window again but above the previous layer
117
-     * (aka media overlay), and above the window. Consequently, it is advisable
118
-     * to limit the number of utilized layers in the stacking space to the
119
-     * minimum sufficient for the desired display. For example, a video call
120
-     * application usually needs a maximum of two zOrder values: 0 for the
121
-     * remote video(s) which appear in the background, and 1 for the local
122
-     * video(s) which appear above the remote video(s).
123
-     */
124
-    zOrder: React.PropTypes.number
125
-};

+ 7
- 7
react/features/base/media/components/native/VideoTrack.js 查看文件

@@ -11,6 +11,13 @@ import { styles } from './styles';
11 11
  * @extends AbstractVideoTrack
12 12
  */
13 13
 class VideoTrack extends AbstractVideoTrack {
14
+    /**
15
+     * VideoTrack component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = AbstractVideoTrack.propTypes
20
+
14 21
     /**
15 22
      * Initializes a new VideoTrack instance.
16 23
      *
@@ -153,11 +160,4 @@ class VideoTrack extends AbstractVideoTrack {
153 160
     }
154 161
 }
155 162
 
156
-/**
157
- * VideoTrack component's property types.
158
- *
159
- * @static
160
- */
161
-VideoTrack.propTypes = AbstractVideoTrack.propTypes;
162
-
163 163
 export default connect()(VideoTrack);

+ 34
- 34
react/features/base/react/components/AbstractContainer.js 查看文件

@@ -6,6 +6,40 @@ import React, { Component } from 'react';
6 6
  * @extends Component
7 7
  */
8 8
 export default class AbstractContainer extends Component {
9
+    /**
10
+     * AbstractContainer component's property types.
11
+     *
12
+     * @static
13
+     */
14
+    static propTypes = {
15
+        children: React.PropTypes.node,
16
+
17
+        /**
18
+         * The event handler/listener to be invoked when this AbstractContainer
19
+         * is clicked on Web or pressed on React Native. If onClick is defined
20
+         * and touchFeedback is undefined, touchFeedback is considered defined
21
+         * as true.
22
+         */
23
+        onClick: React.PropTypes.func,
24
+
25
+        /**
26
+         * The style (as in stylesheet) to be applied to this AbstractContainer.
27
+         */
28
+        style: React.PropTypes.object,
29
+
30
+        /**
31
+         * True if this instance is to provide visual feedback when touched;
32
+         * otherwise, false. If touchFeedback is undefined and onClick is
33
+         * defined, touchFeedback is considered defined as true.
34
+         */
35
+        touchFeedback: React.PropTypes.bool,
36
+
37
+        /**
38
+         * True if this AbstractContainer is to be visible or false if this
39
+         * instance is to be hidden or not rendered at all.
40
+         */
41
+        visible: React.PropTypes.bool
42
+    }
9 43
 
10 44
     /**
11 45
      * Renders this AbstractContainer as a React Component of a specific type.
@@ -38,37 +72,3 @@ export default class AbstractContainer extends Component {
38 72
         return React.createElement(type, filteredProps, children);
39 73
     }
40 74
 }
41
-
42
-/**
43
- * AbstractContainer component's property types.
44
- *
45
- * @static
46
- */
47
-AbstractContainer.propTypes = {
48
-    children: React.PropTypes.node,
49
-
50
-    /**
51
-     * The event handler/listener to be invoked when this AbstractContainer is
52
-     * clicked on Web or pressed on React Native. If onClick is defined and
53
-     * touchFeedback is undefined, touchFeedback is considered defined as true.
54
-     */
55
-    onClick: React.PropTypes.func,
56
-
57
-    /**
58
-     * The style (as in stylesheet) to be applied to this AbstractContainer.
59
-     */
60
-    style: React.PropTypes.object,
61
-
62
-    /**
63
-     * True if this instance is to provide visual feedback when touched;
64
-     * otherwise, false. If touchFeedback is undefined and onClick is defined,
65
-     * touchFeedback is considered defined as true.
66
-     */
67
-    touchFeedback: React.PropTypes.bool,
68
-
69
-    /**
70
-     * True if this AbstractContainer is to be visible or false if this instance
71
-     * is to be hidden or not rendered at all.
72
-     */
73
-    visible: React.PropTypes.bool
74
-};

+ 6
- 7
react/features/base/react/components/Container.native.js 查看文件

@@ -14,6 +14,12 @@ import AbstractContainer from './AbstractContainer';
14 14
  * @extends AbstractContainer
15 15
  */
16 16
 export class Container extends AbstractContainer {
17
+    /**
18
+     * Container component's property types.
19
+     *
20
+     * @static
21
+     */
22
+    static propTypes = AbstractContainer.propTypes
17 23
 
18 24
     /**
19 25
      * Implements React's {@link Component#render()}.
@@ -74,10 +80,3 @@ export class Container extends AbstractContainer {
74 80
         return component;
75 81
     }
76 82
 }
77
-
78
-/**
79
- * Container component's property types.
80
- *
81
- * @static
82
- */
83
-Container.propTypes = AbstractContainer.propTypes;

+ 27
- 25
react/features/base/react/components/Link.native.js 查看文件

@@ -6,6 +6,33 @@ import { Linking, Text } from 'react-native';
6 6
  * and its href attribute.
7 7
  */
8 8
 export class Link extends Component {
9
+    /**
10
+     * Link component's property types.
11
+     *
12
+     * @static
13
+     */
14
+    static propTypes = {
15
+        /**
16
+         * The children to be displayed within this Link.
17
+         */
18
+        children: React.PropTypes.node,
19
+
20
+        /**
21
+         * Notifies that this Link failed to open the URL associated with it.
22
+         */
23
+        onLinkingOpenURLRejected: React.PropTypes.func,
24
+
25
+        /**
26
+         * The CSS style to be applied to this Link for the purposes of display.
27
+         */
28
+        style: React.PropTypes.object,
29
+
30
+        /**
31
+         * The URL to be opened when this Link is clicked/pressed.
32
+         */
33
+        url: React.PropTypes.string
34
+    }
35
+
9 36
     /**
10 37
      * Initializes a new Link instance.
11 38
      *
@@ -60,28 +87,3 @@ export class Link extends Component {
60 87
             .catch(reason => this._onLinkingOpenURLRejected(reason));
61 88
     }
62 89
 }
63
-
64
-/**
65
- * Link component's property types.
66
- */
67
-Link.propTypes = {
68
-    /**
69
-     * The children to be displayed within this Link.
70
-     */
71
-    children: React.PropTypes.node,
72
-
73
-    /**
74
-     * Notifies that this Link failed to open the URL associated with it.
75
-     */
76
-    onLinkingOpenURLRejected: React.PropTypes.func,
77
-
78
-    /**
79
-     * The CSS style to be applied to this Link for the purposes of display.
80
-     */
81
-    style: React.PropTypes.object,
82
-
83
-    /**
84
-     * The URL to be opened when this Link is clicked/pressed.
85
-     */
86
-    url: React.PropTypes.string
87
-};

+ 14
- 15
react/features/conference/components/Avatar.native.js 查看文件

@@ -7,6 +7,20 @@ import { styles } from './styles';
7 7
  * Display a participant avatar.
8 8
  */
9 9
 export default class Avatar extends Component {
10
+    /**
11
+     * Avatar component's property types.
12
+     *
13
+     * @static
14
+     */
15
+    static propTypes = {
16
+        /**
17
+         * The optional style to add to an Avatar in order to customize its base
18
+         * look (and feel).
19
+         */
20
+        style: React.PropTypes.object,
21
+        uri: React.PropTypes.string
22
+    }
23
+
10 24
     /**
11 25
      * Implements React's {@link Component#render()}.
12 26
      *
@@ -23,18 +37,3 @@ export default class Avatar extends Component {
23 37
         );
24 38
     }
25 39
 }
26
-
27
-/**
28
- * Avatar component's property types.
29
- *
30
- * @static
31
- */
32
-Avatar.propTypes = {
33
-
34
-    /**
35
-     * The optional style to add to an Avatar in order to customize its base
36
-     * look (and feel).
37
-     */
38
-    style: React.PropTypes.object,
39
-    uri: React.PropTypes.string
40
-};

+ 8
- 9
react/features/conference/components/Conference.native.js 查看文件

@@ -21,6 +21,14 @@ const TOOLBAR_TIMEOUT_MS = 5000;
21 21
  * The conference page of the application.
22 22
  */
23 23
 class Conference extends Component {
24
+    /**
25
+     * Conference component's property types.
26
+     *
27
+     * @static
28
+     */
29
+    static propTypes = {
30
+        dispatch: React.PropTypes.func
31
+    }
24 32
 
25 33
     /**
26 34
      * Initializes a new Conference instance.
@@ -125,13 +133,4 @@ class Conference extends Component {
125 133
     }
126 134
 }
127 135
 
128
-/**
129
- * Conference component's property types.
130
- *
131
- * @static
132
- */
133
-Conference.propTypes = {
134
-    dispatch: React.PropTypes.func
135
-};
136
-
137 136
 export default reactReduxConnect()(Conference);

+ 57
- 59
react/features/conference/components/ParticipantView.native.js 查看文件

@@ -20,6 +20,63 @@ import { styles } from './styles';
20 20
  * @extends Component
21 21
  */
22 22
 class ParticipantView extends Component {
23
+    /**
24
+     * ParticipantView component's property types.
25
+     *
26
+     * @static
27
+     */
28
+    static propTypes = {
29
+        /**
30
+         * The source (e.g. URI, URL) of the avatar image of the participant
31
+         * with {@link #participantId}.
32
+         *
33
+         * @private
34
+         */
35
+        _avatar: React.PropTypes.string,
36
+
37
+        /**
38
+         * The video Track of the participant with {@link #participantId}.
39
+         */
40
+        _videoTrack: React.PropTypes.object,
41
+
42
+        /**
43
+         * The style, if any, of the avatar in addition to the default style.
44
+         */
45
+        avatarStyle: React.PropTypes.object,
46
+
47
+        /**
48
+         * The ID of the participant (to be) depicted by ParticipantView.
49
+         *
50
+         * @public
51
+         */
52
+        participantId: React.PropTypes.string,
53
+
54
+        /**
55
+         * True if the avatar of the depicted participant is to be shown should
56
+         * the avatar be available and the video of the participant is not to be
57
+         * shown; otherwise, false. If undefined, defaults to true.
58
+         */
59
+        showAvatar: React.PropTypes.bool,
60
+
61
+        /**
62
+         * True if the video of the depicted participant is to be shown should
63
+         * the video be available. If undefined, defaults to true.
64
+         */
65
+        showVideo: React.PropTypes.bool,
66
+
67
+        /**
68
+         * The style, if any, to apply to ParticipantView in addition to its
69
+         * default style.
70
+         */
71
+        style: React.PropTypes.object,
72
+
73
+        /**
74
+         * The z-order of the Video of ParticipantView in the stacking space of
75
+         * all Videos. For more details, refer to the zOrder property of the
76
+         * Video class for React Native.
77
+         */
78
+        zOrder: React.PropTypes.number
79
+    }
23 80
 
24 81
     /**
25 82
      * Implements React's {@link Component#render()}.
@@ -77,65 +134,6 @@ class ParticipantView extends Component {
77 134
     }
78 135
 }
79 136
 
80
-/**
81
- * ParticipantView component's property types.
82
- *
83
- * @static
84
- */
85
-ParticipantView.propTypes = {
86
-
87
-    /**
88
-     * The source (e.g. URI, URL) of the avatar image of the participant with
89
-     * {@link #participantId}.
90
-     *
91
-     * @private
92
-     */
93
-    _avatar: React.PropTypes.string,
94
-
95
-    /**
96
-     * The video Track of the participant with {@link #participantId}.
97
-     */
98
-    _videoTrack: React.PropTypes.object,
99
-
100
-    /**
101
-     * The style, if any, of the avatar in addition to the default style.
102
-     */
103
-    avatarStyle: React.PropTypes.object,
104
-
105
-    /**
106
-     * The ID of the participant (to be) depicted by ParticipantView.
107
-     *
108
-     * @public
109
-     */
110
-    participantId: React.PropTypes.string,
111
-
112
-    /**
113
-     * True if the avatar of the depicted participant is to be shown should the
114
-     * avatar be available and the video of the participant is not to be shown;
115
-     * otherwise, false. If undefined, defaults to true.
116
-     */
117
-    showAvatar: React.PropTypes.bool,
118
-
119
-    /**
120
-     * True if the video of the depicted participant is to be shown should the
121
-     * video be available. If undefined, defaults to true.
122
-     */
123
-    showVideo: React.PropTypes.bool,
124
-
125
-    /**
126
-     * The style, if any, to apply to ParticipantView in addition to its default
127
-     * style.
128
-     */
129
-    style: React.PropTypes.object,
130
-
131
-    /**
132
-     * The z-order of the Video of ParticipantView in the stacking space of all
133
-     * Videos. For more details, refer to the zOrder property of the Video class
134
-     * for React Native.
135
-     */
136
-    zOrder: React.PropTypes.number
137
-};
138
-
139 137
 /**
140 138
  * Converts the specified value to a boolean value. If the specified value is
141 139
  * undefined, returns the boolean value of undefinedValue.

+ 10
- 10
react/features/filmStrip/components/FilmStrip.js 查看文件

@@ -13,6 +13,16 @@ import { styles } from './_';
13 13
  * @extends Component
14 14
  */
15 15
 class FilmStrip extends Component {
16
+    /**
17
+     * FilmStrip component's property types.
18
+     *
19
+     * @static
20
+     */
21
+    static propTypes = {
22
+        participants: React.PropTypes.array,
23
+        visible: React.PropTypes.bool.isRequired
24
+    }
25
+
16 26
     /**
17 27
      * Implements React's {@link Component#render()}.
18 28
      *
@@ -79,16 +89,6 @@ class FilmStrip extends Component {
79 89
     }
80 90
 }
81 91
 
82
-/**
83
- * FilmStrip component's property types.
84
- *
85
- * @static
86
- */
87
-FilmStrip.propTypes = {
88
-    participants: React.PropTypes.array,
89
-    visible: React.PropTypes.bool.isRequired
90
-};
91
-
92 92
 /**
93 93
  * Function that maps parts of Redux state tree into component props.
94 94
  *

+ 13
- 13
react/features/filmStrip/components/Thumbnail.js 查看文件

@@ -26,6 +26,19 @@ import {
26 26
  * @extends Component
27 27
  */
28 28
 class Thumbnail extends Component {
29
+    /**
30
+     * Thumbnail component's property types.
31
+     *
32
+     * @static
33
+     */
34
+    static propTypes = {
35
+        audioTrack: React.PropTypes.object,
36
+        dispatch: React.PropTypes.func,
37
+        largeVideo: React.PropTypes.object,
38
+        participant: React.PropTypes.object,
39
+        videoTrack: React.PropTypes.object
40
+    }
41
+
29 42
     /**
30 43
      * Initializes new Video Thumbnail component.
31 44
      *
@@ -119,19 +132,6 @@ class Thumbnail extends Component {
119 132
     }
120 133
 }
121 134
 
122
-/**
123
- * Thumbnail component's property types.
124
- *
125
- * @static
126
- */
127
-Thumbnail.propTypes = {
128
-    audioTrack: React.PropTypes.object,
129
-    dispatch: React.PropTypes.func,
130
-    largeVideo: React.PropTypes.object,
131
-    participant: React.PropTypes.object,
132
-    videoTrack: React.PropTypes.object
133
-};
134
-
135 135
 /**
136 136
  * Function that maps parts of Redux state tree into component props.
137 137
  *

+ 14
- 15
react/features/largeVideo/components/LargeVideo.js 查看文件

@@ -11,6 +11,20 @@ import { styles } from './styles';
11 11
  * @extends Component
12 12
  */
13 13
 class LargeVideo extends Component {
14
+    /**
15
+     * LargeVideo component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = {
20
+        /**
21
+         * The ID of the participant (to be) depicted by LargeVideo.
22
+         *
23
+         * @private
24
+         */
25
+        _participantId: React.PropTypes.string
26
+    }
27
+
14 28
     /**
15 29
      * Implements React's {@link Component#render()}.
16 30
      *
@@ -28,21 +42,6 @@ class LargeVideo extends Component {
28 42
     }
29 43
 }
30 44
 
31
-/**
32
- * LargeVideo component's property types.
33
- *
34
- * @static
35
- */
36
-LargeVideo.propTypes = {
37
-
38
-    /**
39
-     * The ID of the participant (to be) depicted by LargeVideo.
40
-     *
41
-     * @private
42
-     */
43
-    _participantId: React.PropTypes.string
44
-};
45
-
46 45
 /**
47 46
  * Maps (parts of) the Redux state to the associated LargeVideo's props.
48 47
  *

+ 12
- 12
react/features/toolbar/components/AbstractToolbar.js 查看文件

@@ -15,6 +15,18 @@ import { styles } from './styles';
15 15
  * @abstract
16 16
  */
17 17
 export class AbstractToolbar extends Component {
18
+    /**
19
+     * AbstractToolbar component's property types.
20
+     *
21
+     * @static
22
+     */
23
+    static propTypes = {
24
+        audioMuted: React.PropTypes.bool,
25
+        dispatch: React.PropTypes.func,
26
+        videoMuted: React.PropTypes.bool,
27
+        visible: React.PropTypes.bool.isRequired
28
+    }
29
+
18 30
     /**
19 31
      * Initializes a new AbstractToolbar instance.
20 32
      *
@@ -104,18 +116,6 @@ export class AbstractToolbar extends Component {
104 116
     }
105 117
 }
106 118
 
107
-/**
108
- * AbstractToolbar component's property types.
109
- *
110
- * @static
111
- */
112
-AbstractToolbar.propTypes = {
113
-    audioMuted: React.PropTypes.bool,
114
-    dispatch: React.PropTypes.func,
115
-    videoMuted: React.PropTypes.bool,
116
-    visible: React.PropTypes.bool.isRequired
117
-};
118
-
119 119
 /**
120 120
  * Maps parts of media state to component props.
121 121
  *

+ 23
- 25
react/features/toolbar/components/AbstractToolbarButton.js 查看文件

@@ -6,6 +6,29 @@ import React, { Component } from 'react';
6 6
  * @abstract
7 7
  */
8 8
 export default class AbstractToolbarButton extends Component {
9
+    /**
10
+     * AbstractToolbarButton component's property types.
11
+     *
12
+     * @static
13
+     */
14
+    static propTypes = {
15
+        /**
16
+         * The name of the Icon of this AbstractToolbarButton.
17
+         */
18
+        iconName: React.PropTypes.string,
19
+
20
+        /**
21
+         * The style of the Icon of this AbstractToolbarButton.
22
+         */
23
+        iconStyle: React.PropTypes.object,
24
+        onClick: React.PropTypes.func,
25
+        style:
26
+            React.PropTypes.oneOfType([
27
+                React.PropTypes.array,
28
+                React.PropTypes.object
29
+            ]),
30
+        underlayColor: React.PropTypes.any
31
+    }
9 32
 
10 33
     /**
11 34
      * Implements React's {@link Component#render()}.
@@ -34,28 +57,3 @@ export default class AbstractToolbarButton extends Component {
34 57
         return React.createElement(type, props);
35 58
     }
36 59
 }
37
-
38
-/**
39
- * AbstractToolbarButton component's property types.
40
- *
41
- * @static
42
- */
43
-AbstractToolbarButton.propTypes = {
44
-
45
-    /**
46
-     * The name of the Icon of this AbstractToolbarButton.
47
-     */
48
-    iconName: React.PropTypes.string,
49
-
50
-    /**
51
-     * The style of the Icon of this AbstractToolbarButton.
52
-     */
53
-    iconStyle: React.PropTypes.object,
54
-    onClick: React.PropTypes.func,
55
-    style:
56
-        React.PropTypes.oneOfType([
57
-            React.PropTypes.array,
58
-            React.PropTypes.object
59
-        ]),
60
-    underlayColor: React.PropTypes.any
61
-};

+ 7
- 7
react/features/toolbar/components/Toolbar.native.js 查看文件

@@ -22,6 +22,13 @@ import ToolbarButton from './ToolbarButton';
22 22
  * @extends AbstractToolbar
23 23
  */
24 24
 class Toolbar extends AbstractToolbar {
25
+    /**
26
+     * Toolbar component's property types.
27
+     *
28
+     * @static
29
+     */
30
+    static propTypes = AbstractToolbar.propTypes
31
+
25 32
     /**
26 33
      * Initializes a new Toolbar instance.
27 34
      *
@@ -116,11 +123,4 @@ Object.assign(Toolbar.prototype, {
116 123
     videoMutedIcon: 'camera-disabled'
117 124
 });
118 125
 
119
-/**
120
- * Toolbar component's property types.
121
- *
122
- * @static
123
- */
124
-Toolbar.propTypes = AbstractToolbar.propTypes;
125
-
126 126
 export default connect(mapStateToProps)(Toolbar);

+ 6
- 7
react/features/toolbar/components/ToolbarButton.native.js 查看文件

@@ -11,6 +11,12 @@ import AbstractToolbarButton from './AbstractToolbarButton';
11 11
  * @extends AbstractToolbarButton
12 12
  */
13 13
 export default class ToolbarButton extends AbstractToolbarButton {
14
+    /**
15
+     * ToolbarButton component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = AbstractToolbarButton.propTypes
14 20
 
15 21
     /**
16 22
      * Renders the button of this Toolbar button.
@@ -39,10 +45,3 @@ export default class ToolbarButton extends AbstractToolbarButton {
39 45
         return super._renderIcon(Icon);
40 46
     }
41 47
 }
42
-
43
-/**
44
- * ToolbarButton component's property types.
45
- *
46
- * @static
47
- */
48
-ToolbarButton.propTypes = AbstractToolbarButton.propTypes;

+ 11
- 11
react/features/welcome/components/AbstractWelcomePage.js 查看文件

@@ -11,6 +11,17 @@ import { getLocalVideoTrack } from '../../base/tracks';
11 11
  * @abstract
12 12
  */
13 13
 export class AbstractWelcomePage extends Component {
14
+    /**
15
+     * AbstractWelcomePage component's property types.
16
+     *
17
+     * @static
18
+     */
19
+    static propTypes = {
20
+        dispatch: React.PropTypes.func,
21
+        localVideoTrack: React.PropTypes.object,
22
+        room: React.PropTypes.string
23
+    }
24
+
14 25
     /**
15 26
      * Initializes a new AbstractWelcomePage instance, including the initial
16 27
      * state of the room name input.
@@ -91,17 +102,6 @@ export class AbstractWelcomePage extends Component {
91 102
     }
92 103
 }
93 104
 
94
-/**
95
- * AbstractWelcomePage component's property types.
96
- *
97
- * @static
98
- */
99
-AbstractWelcomePage.propTypes = {
100
-    dispatch: React.PropTypes.func,
101
-    localVideoTrack: React.PropTypes.object,
102
-    room: React.PropTypes.string
103
-};
104
-
105 105
 /**
106 106
  * Selects local video track from tracks in state, local participant and room
107 107
  * and maps them to component props. It seems it's not possible to 'connect'

+ 7
- 7
react/features/welcome/components/WelcomePage.native.js 查看文件

@@ -25,6 +25,13 @@ const TERMS_OF_SERVICE_URL
25 25
  * @extends AbstractWelcomePage
26 26
  */
27 27
 class WelcomePage extends AbstractWelcomePage {
28
+    /**
29
+     * WelcomePage component's property types.
30
+     *
31
+     * @static
32
+     */
33
+    static propTypes = AbstractWelcomePage.propTypes
34
+
28 35
     /**
29 36
      * Renders a prompt for entering a room name.
30 37
      *
@@ -90,11 +97,4 @@ class WelcomePage extends AbstractWelcomePage {
90 97
     }
91 98
 }
92 99
 
93
-/**
94
- * WelcomePage component's property types.
95
- *
96
- * @static
97
- */
98
-WelcomePage.propTypes = AbstractWelcomePage.propTypes;
99
-
100 100
 export default connect(mapStateToProps)(WelcomePage);

正在加载...
取消
保存