瀏覽代碼

feat(overlays): switch to flow Props

j8
Saúl Ibarra Corretgé 7 年之前
父節點
當前提交
19702671f6
共有 1 個文件被更改,包括 16 次插入14 次删除
  1. 16
    14
      react/features/overlay/components/OverlayContainer.js

+ 16
- 14
react/features/overlay/components/OverlayContainer.js 查看文件

@@ -1,6 +1,5 @@
1
-/* global interfaceConfig */
1
+// @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -14,6 +13,8 @@ import UserMediaPermissionsFilmstripOnlyOverlay
14 13
     from './UserMediaPermissionsFilmstripOnlyOverlay';
15 14
 import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
16 15
 
16
+declare var interfaceConfig: Object;
17
+
17 18
 /**
18 19
  * The lazily-initialized list of overlay React {@link Component} types used The
19 20
  * user interface is filmstrip-only.
@@ -39,22 +40,23 @@ let _filmstripOnlyOverlays;
39 40
 let _nonFilmstripOnlyOverlays;
40 41
 
41 42
 /**
42
- * Implements a React {@link Component} that will display the correct overlay
43
- * when needed.
43
+ * OverlayContainer component's property types.
44 44
  */
45
-class OverlayContainer extends Component {
45
+type Props = {
46
+
46 47
     /**
47
-     * OverlayContainer component's property types.
48
-     *
49
-     * @static
48
+     * Type of overlay that should be rendered.
49
+     * XXX: We are using 'any' here because overlays are usually wrapped in
50
+     * functions, so a 'Node' won't do.
50 51
      */
51
-    static propTypes = {
52
-        /**
53
-         * Type of overlay that should be rendered.
54
-         */
55
-        overlay: PropTypes.element
56
-    };
52
+    overlay: any
53
+}
57 54
 
55
+/**
56
+ * Implements a React {@link Component} that will display the correct overlay
57
+ * when needed.
58
+ */
59
+class OverlayContainer extends Component<Props> {
58 60
     /**
59 61
      * Implements React's {@link Component#render()}.
60 62
      *

Loading…
取消
儲存