Просмотр исходного кода

Reorg overlay feature files

master
Bettenbuk Zoltan 6 лет назад
Родитель
Сommit
84b917d708
23 измененных файлов: 97 добавлений и 71 удалений
  1. 2
    0
      react/features/overlay/actionTypes.js
  2. 4
    2
      react/features/overlay/actions.js
  3. 3
    1
      react/features/overlay/components/AbstractPageReloadOverlay.js
  4. 3
    0
      react/features/overlay/components/_.native.js
  5. 3
    0
      react/features/overlay/components/_.web.js
  6. 3
    14
      react/features/overlay/components/index.js
  7. 0
    0
      react/features/overlay/components/native/OverlayFrame.js
  8. 10
    8
      react/features/overlay/components/native/PageReloadOverlay.js
  9. 4
    0
      react/features/overlay/components/native/index.js
  10. 3
    1
      react/features/overlay/components/native/styles.js
  11. 1
    1
      react/features/overlay/components/web/AbstractSuspendedOverlay.js
  12. 1
    1
      react/features/overlay/components/web/AbstractUserMediaPermissionsOverlay.js
  13. 2
    2
      react/features/overlay/components/web/FilmstripOnlyOverlayFrame.js
  14. 1
    1
      react/features/overlay/components/web/OverlayFrame.js
  15. 12
    5
      react/features/overlay/components/web/PageReloadFilmstripOnlyOverlay.js
  16. 4
    3
      react/features/overlay/components/web/PageReloadOverlay.js
  17. 4
    4
      react/features/overlay/components/web/ReloadButton.js
  18. 3
    1
      react/features/overlay/components/web/SuspendedFilmstripOnlyOverlay.js
  19. 3
    1
      react/features/overlay/components/web/SuspendedOverlay.js
  20. 4
    2
      react/features/overlay/components/web/UserMediaPermissionsFilmstripOnlyOverlay.js
  21. 6
    24
      react/features/overlay/components/web/UserMediaPermissionsOverlay.js
  22. 19
    0
      react/features/overlay/components/web/index.js
  23. 2
    0
      react/features/overlay/index.js

+ 2
- 0
react/features/overlay/actionTypes.js Просмотреть файл

@@ -1,3 +1,5 @@
1
+// @flow
2
+
1 3
 /**
2 4
  * The type of the Redux action which signals that the prompt for media
3 5
  * permission is visible or not.

+ 4
- 2
react/features/overlay/actions.js Просмотреть файл

@@ -1,3 +1,5 @@
1
+// @flow
2
+
1 3
 import {
2 4
     MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
3 5
     SET_FATAL_ERROR,
@@ -17,7 +19,7 @@ import {
17 19
  *     isVisible: {boolean}
18 20
  * }}
19 21
  */
20
-export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
22
+export function mediaPermissionPromptVisibilityChanged(isVisible: boolean, browser: string) {
21 23
     return {
22 24
         type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
23 25
         browser,
@@ -51,7 +53,7 @@ export function suspendDetected() {
51 53
  *     fatalError: ?Error
52 54
  * }}
53 55
  */
54
-export function setFatalError(fatalError) {
56
+export function setFatalError(fatalError: Object) {
55 57
     return {
56 58
         type: SET_FATAL_ERROR,
57 59
         fatalError

+ 3
- 1
react/features/overlay/components/AbstractPageReloadOverlay.js Просмотреть файл

@@ -14,7 +14,7 @@ import {
14 14
     isFatalJitsiConnectionError
15 15
 } from '../../base/lib-jitsi-meet';
16 16
 
17
-import ReloadButton from './ReloadButton';
17
+import ReloadButton from './web/ReloadButton';
18 18
 
19 19
 declare var APP: Object;
20 20
 
@@ -82,6 +82,8 @@ type State = {
82 82
 
83 83
 /**
84 84
  * Implements an abstract React {@link Component} for the page reload overlays.
85
+ *
86
+ * FIXME: This is not really an abstract class as some components and functions are very web specific.
85 87
  */
86 88
 export default class AbstractPageReloadOverlay<P: Props>
87 89
     extends Component<P, State> {

+ 3
- 0
react/features/overlay/components/_.native.js Просмотреть файл

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export * from './native';

+ 3
- 0
react/features/overlay/components/_.web.js Просмотреть файл

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export * from './web';

+ 3
- 14
react/features/overlay/components/index.js Просмотреть файл

@@ -1,15 +1,4 @@
1
+// @flow
2
+
1 3
 export { default as OverlayContainer } from './OverlayContainer';
2
-export {
3
-    default as PageReloadFilmstripOnlyOverlay
4
-} from './PageReloadFilmstripOnlyOverlay';
5
-export { default as PageReloadOverlay } from './PageReloadOverlay';
6
-export {
7
-    default as SuspendedFilmstripOnlyOverlay
8
-} from './SuspendedFilmstripOnlyOverlay';
9
-export { default as SuspendedOverlay } from './SuspendedOverlay';
10
-export {
11
-    default as UserMediaPermissionsFilmstripOnlyOverlay
12
-} from './UserMediaPermissionsFilmstripOnlyOverlay';
13
-export {
14
-    default as UserMediaPermissionsOverlay
15
-} from './UserMediaPermissionsOverlay';
4
+export * from './_';

react/features/overlay/components/OverlayFrame.native.js → react/features/overlay/components/native/OverlayFrame.js Просмотреть файл


react/features/overlay/components/PageReloadOverlay.native.js → react/features/overlay/components/native/PageReloadOverlay.js Просмотреть файл

@@ -3,18 +3,20 @@
3 3
 import React from 'react';
4 4
 import { Text } from 'react-native';
5 5
 
6
-import { appNavigate, reloadNow } from '../../app';
7
-import { ColorSchemeRegistry } from '../../base/color-scheme';
8
-import { ConfirmDialog } from '../../base/dialog';
9
-import { translate } from '../../base/i18n';
10
-import { connect } from '../../base/redux';
11
-import { StyleType } from '../../base/styles';
6
+import { appNavigate, reloadNow } from '../../../app';
7
+import { ColorSchemeRegistry } from '../../../base/color-scheme';
8
+import { ConfirmDialog } from '../../../base/dialog';
9
+import { translate } from '../../../base/i18n';
10
+import { connect } from '../../../base/redux';
11
+import { StyleType } from '../../../base/styles';
12
+
13
+import { setFatalError } from '../../actions';
12 14
 
13 15
 import AbstractPageReloadOverlay, {
14 16
     abstractMapStateToProps,
15 17
     type Props as AbstractProps
16
-} from './AbstractPageReloadOverlay';
17
-import { setFatalError } from '../actions';
18
+} from '../AbstractPageReloadOverlay';
19
+
18 20
 import OverlayFrame from './OverlayFrame';
19 21
 
20 22
 type Props = AbstractProps & {

+ 4
- 0
react/features/overlay/components/native/index.js Просмотреть файл

@@ -0,0 +1,4 @@
1
+// @flow
2
+
3
+export { default as OverlayFrame } from './OverlayFrame';
4
+export { default as PageReloadOverlay } from './PageReloadOverlay';

react/features/overlay/components/styles.js → react/features/overlay/components/native/styles.js Просмотреть файл

@@ -1,6 +1,8 @@
1
+// @flow
2
+
1 3
 import { StyleSheet } from 'react-native';
2 4
 
3
-import { ColorPalette, createStyleSheet } from '../../base/styles';
5
+import { ColorPalette } from '../../../base/styles';
4 6
 
5 7
 /**
6 8
  * The React {@code Component} styles of {@code OverlayFrame}.

react/features/overlay/components/AbstractSuspendedOverlay.js → react/features/overlay/components/web/AbstractSuspendedOverlay.js Просмотреть файл

@@ -1,4 +1,4 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import { Component } from 'react';
4 4
 

react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js → react/features/overlay/components/web/AbstractUserMediaPermissionsOverlay.js Просмотреть файл

@@ -1,4 +1,4 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import { Component } from 'react';
4 4
 

react/features/overlay/components/FilmstripOnlyOverlayFrame.js → react/features/overlay/components/web/FilmstripOnlyOverlayFrame.js Просмотреть файл

@@ -6,8 +6,8 @@ import {
6 6
     Avatar,
7 7
     getAvatarURL,
8 8
     getLocalParticipant
9
-} from '../../base/participants';
10
-import { connect } from '../../base/redux';
9
+} from '../../../base/participants';
10
+import { connect } from '../../../base/redux';
11 11
 
12 12
 import OverlayFrame from './OverlayFrame';
13 13
 

react/features/overlay/components/OverlayFrame.web.js → react/features/overlay/components/web/OverlayFrame.js Просмотреть файл

@@ -1,4 +1,4 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 

react/features/overlay/components/PageReloadFilmstripOnlyOverlay.js → react/features/overlay/components/web/PageReloadFilmstripOnlyOverlay.js Просмотреть файл

@@ -1,10 +1,13 @@
1
+// @flow
2
+
1 3
 import React from 'react';
2 4
 
3
-import { translate } from '../../base/i18n';
4
-import { connect } from '../../base/redux';
5
+import { translate } from '../../../base/i18n';
6
+import { connect } from '../../../base/redux';
7
+
8
+import AbstractPageReloadOverlay, { type Props, abstractMapStateToProps }
9
+    from '../AbstractPageReloadOverlay';
5 10
 
6
-import AbstractPageReloadOverlay, { abstractMapStateToProps }
7
-    from './AbstractPageReloadOverlay';
8 11
 import FilmstripOnlyOverlayFrame from './FilmstripOnlyOverlayFrame';
9 12
 
10 13
 /**
@@ -12,7 +15,7 @@ import FilmstripOnlyOverlayFrame from './FilmstripOnlyOverlayFrame';
12 15
  * mode. Shown before the conference is reloaded. Shows a warning message and
13 16
  * counts down towards the reload.
14 17
  */
15
-class PageReloadFilmstripOnlyOverlay extends AbstractPageReloadOverlay {
18
+class PageReloadFilmstripOnlyOverlay extends AbstractPageReloadOverlay<Props> {
16 19
     /**
17 20
      * Implements React's {@link Component#render()}.
18 21
      *
@@ -38,6 +41,10 @@ class PageReloadFilmstripOnlyOverlay extends AbstractPageReloadOverlay {
38 41
             </FilmstripOnlyOverlayFrame>
39 42
         );
40 43
     }
44
+
45
+    _renderButton: () => React$Element<*> | null
46
+
47
+    _renderProgressBar: () => React$Element<*> | null
41 48
 }
42 49
 
43 50
 export default translate(

react/features/overlay/components/PageReloadOverlay.web.js → react/features/overlay/components/web/PageReloadOverlay.js Просмотреть файл

@@ -2,13 +2,14 @@
2 2
 
3 3
 import React from 'react';
4 4
 
5
-import { translate } from '../../base/i18n';
6
-import { connect } from '../../base/redux';
5
+import { translate } from '../../../base/i18n';
6
+import { connect } from '../../../base/redux';
7 7
 
8 8
 import AbstractPageReloadOverlay, {
9 9
     abstractMapStateToProps,
10 10
     type Props
11
-} from './AbstractPageReloadOverlay';
11
+} from '../AbstractPageReloadOverlay';
12
+
12 13
 import OverlayFrame from './OverlayFrame';
13 14
 
14 15
 /**

react/features/overlay/components/ReloadButton.js → react/features/overlay/components/web/ReloadButton.js Просмотреть файл

@@ -1,10 +1,10 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { reloadNow } from '../../app';
6
-import { translate } from '../../base/i18n';
7
-import { connect } from '../../base/redux';
5
+import { reloadNow } from '../../../app';
6
+import { translate } from '../../../base/i18n';
7
+import { connect } from '../../../base/redux';
8 8
 
9 9
 /**
10 10
  * The type of the React {@code Component} props of {@link ReloadButton}.

react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js → react/features/overlay/components/web/SuspendedFilmstripOnlyOverlay.js Просмотреть файл

@@ -1,6 +1,8 @@
1
+// @flow
2
+
1 3
 import React from 'react';
2 4
 
3
-import { translate, translateToHTML } from '../../base/i18n';
5
+import { translate, translateToHTML } from '../../../base/i18n';
4 6
 
5 7
 import AbstractSuspendedOverlay from './AbstractSuspendedOverlay';
6 8
 import FilmstripOnlyOverlayFrame from './FilmstripOnlyOverlayFrame';

react/features/overlay/components/SuspendedOverlay.js → react/features/overlay/components/web/SuspendedOverlay.js Просмотреть файл

@@ -1,6 +1,8 @@
1
+// @flow
2
+
1 3
 import React from 'react';
2 4
 
3
-import { translate, translateToHTML } from '../../base/i18n';
5
+import { translate, translateToHTML } from '../../../base/i18n';
4 6
 
5 7
 import AbstractSuspendedOverlay from './AbstractSuspendedOverlay';
6 8
 import OverlayFrame from './OverlayFrame';

react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js → react/features/overlay/components/web/UserMediaPermissionsFilmstripOnlyOverlay.js Просмотреть файл

@@ -1,7 +1,9 @@
1
+// @flow
2
+
1 3
 import React from 'react';
2 4
 
3
-import { translate, translateToHTML } from '../../base/i18n';
4
-import { connect } from '../../base/redux';
5
+import { translate, translateToHTML } from '../../../base/i18n';
6
+import { connect } from '../../../base/redux';
5 7
 
6 8
 import AbstractUserMediaPermissionsOverlay, { abstractMapStateToProps }
7 9
     from './AbstractUserMediaPermissionsOverlay';

react/features/overlay/components/UserMediaPermissionsOverlay.js → react/features/overlay/components/web/UserMediaPermissionsOverlay.js Просмотреть файл

@@ -1,39 +1,21 @@
1
-/* global interfaceConfig */
1
+// @flow
2 2
 
3 3
 import React from 'react';
4 4
 
5
-import { translate, translateToHTML } from '../../base/i18n';
6
-import { connect } from '../../base/redux';
5
+import { translate, translateToHTML } from '../../../base/i18n';
6
+import { connect } from '../../../base/redux';
7 7
 
8 8
 import AbstractUserMediaPermissionsOverlay, { abstractMapStateToProps }
9 9
     from './AbstractUserMediaPermissionsOverlay';
10 10
 import OverlayFrame from './OverlayFrame';
11 11
 
12
+declare var interfaceConfig: Object;
13
+
12 14
 /**
13 15
  * Implements a React Component for overlay with guidance how to proceed with
14 16
  * gUM prompt.
15 17
  */
16 18
 class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
17
-    /**
18
-     * Initializes a new UserMediaPermissionsOverlay instance.
19
-     *
20
-     * @param {Object} props - The read-only properties with which the new
21
-     * instance is to be initialized.
22
-     * @public
23
-     */
24
-    constructor(props) {
25
-        super(props);
26
-
27
-        this.state = {
28
-            /**
29
-             * The src value of the image for the policy logo.
30
-             *
31
-             * @type {string}
32
-             */
33
-            policyLogoSrc: interfaceConfig.POLICY_LOGO
34
-        };
35
-    }
36
-
37 19
     /**
38 20
      * Implements React's {@link Component#render()}.
39 21
      *
@@ -80,7 +62,7 @@ class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
80 62
      * @returns {ReactElement|null}
81 63
      */
82 64
     _renderPolicyLogo() {
83
-        const { policyLogoSrc } = this.state;
65
+        const policyLogoSrc = interfaceConfig.POLICY_LOGO;
84 66
 
85 67
         if (policyLogoSrc) {
86 68
             return (

+ 19
- 0
react/features/overlay/components/web/index.js Просмотреть файл

@@ -0,0 +1,19 @@
1
+// @flow
2
+
3
+export { default as FilmstripOnlyOverlayFrame } from './FilmstripOnlyOverlayFrame';
4
+export { default as OverlayFrame } from './OverlayFrame';
5
+
6
+export {
7
+    default as PageReloadFilmstripOnlyOverlay
8
+} from './PageReloadFilmstripOnlyOverlay';
9
+export { default as PageReloadOverlay } from './PageReloadOverlay';
10
+export {
11
+    default as SuspendedFilmstripOnlyOverlay
12
+} from './SuspendedFilmstripOnlyOverlay';
13
+export { default as SuspendedOverlay } from './SuspendedOverlay';
14
+export {
15
+    default as UserMediaPermissionsFilmstripOnlyOverlay
16
+} from './UserMediaPermissionsFilmstripOnlyOverlay';
17
+export {
18
+    default as UserMediaPermissionsOverlay
19
+} from './UserMediaPermissionsOverlay';

+ 2
- 0
react/features/overlay/index.js Просмотреть файл

@@ -1,3 +1,5 @@
1
+// @flow
2
+
1 3
 export * from './actions';
2 4
 export * from './components';
3 5
 export * from './functions';

Загрузка…
Отмена
Сохранить