Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Reorg notifications feature files

Bettenbuk Zoltan10e951c17c4e
diff --git a/react/features/notifications/actionTypes.js b/react/features/notifications/actionTypes.js
index fe1ef8c339..34fe9e3119 100644
--- a/react/features/notifications/actionTypes.js
+++ b/react/features/notifications/actionTypes.js
@@ -1,3 +1,5 @@
+// @flow
+
/**
* The type of (redux) action which signals that all the stored notifications
* need to be cleared.
diff --git a/react/features/notifications/components/index.native.js b/react/features/notifications/components/index.native.js
new file mode 100644
index 0000000000..a32ec60612
--- /dev/null
+++ b/react/features/notifications/components/index.native.js
@@ -0,0 +1,3 @@
+// @flow
+
+export * from './native';
diff --git a/react/features/notifications/components/index.web.js b/react/features/notifications/components/index.web.js
new file mode 100644
index 0000000000..40d5f46528
--- /dev/null
+++ b/react/features/notifications/components/index.web.js
@@ -0,0 +1,3 @@
+// @flow
+
+export * from './web';
diff --git a/react/features/notifications/components/Notification.native.js b/react/features/notifications/components/native/Notification.js
similarity index 94%
rename from react/features/notifications/components/Notification.native.js
rename to react/features/notifications/components/native/Notification.js
index 4e78d8c039..d3d317562a 100644
--- a/react/features/notifications/components/Notification.native.js
+++ b/react/features/notifications/components/native/Notification.js
@@ -3,12 +3,13 @@
import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
-import { Icon } from '../../base/font-icons';
-import { translate } from '../../base/i18n';
+import { Icon } from '../../../base/font-icons';
+import { translate } from '../../../base/i18n';
import AbstractNotification, {
type Props
-} from './AbstractNotification';
+} from '../AbstractNotification';
+
import styles from './styles';
/**
diff --git a/react/features/notifications/components/NotificationsContainer.native.js b/react/features/notifications/components/native/NotificationsContainer.js
similarity index 94%
rename from react/features/notifications/components/NotificationsContainer.native.js
rename to react/features/notifications/components/native/NotificationsContainer.js
index 1280fb78a3..52a3c91f90 100644
--- a/react/features/notifications/components/NotificationsContainer.native.js
+++ b/react/features/notifications/components/native/NotificationsContainer.js
@@ -3,12 +3,13 @@
import React from 'react';
import { View } from 'react-native';
-import { connect } from '../../base/redux';
+import { connect } from '../../../base/redux';
import AbstractNotificationsContainer, {
_abstractMapStateToProps,
type Props as AbstractProps
-} from './AbstractNotificationsContainer';
+} from '../AbstractNotificationsContainer';
+
import Notification from './Notification';
import styles from './styles';
diff --git a/react/features/notifications/components/index.js b/react/features/notifications/components/native/index.js
similarity index 93%
rename from react/features/notifications/components/index.js
rename to react/features/notifications/components/native/index.js
index 642f2f2837..0f33b32643 100644
--- a/react/features/notifications/components/index.js
+++ b/react/features/notifications/components/native/index.js
@@ -1,2 +1,4 @@
+// @flow
+
export { default as Notification } from './Notification';
export { default as NotificationsContainer } from './NotificationsContainer';
diff --git a/react/features/notifications/components/styles.js b/react/features/notifications/components/native/styles.js
similarity index 90%
rename from react/features/notifications/components/styles.js
rename to react/features/notifications/components/native/styles.js
index 6ecefc1928..07101a8214 100644
--- a/react/features/notifications/components/styles.js
+++ b/react/features/notifications/components/native/styles.js
@@ -1,11 +1,11 @@
// @flow
-import { BoxModel, createStyleSheet, ColorPalette } from '../../base/styles';
+import { BoxModel, ColorPalette } from '../../../base/styles';
/**
* The styles of the React {@code Components} of the feature notifications.
*/
-export default createStyleSheet({
+export default {
/**
* The content (left) column of the notification.
@@ -58,4 +58,4 @@ export default createStyleSheet({
notificationContent: {
flexDirection: 'column'
}
-});
+};
diff --git a/react/features/notifications/components/Notification.web.js b/react/features/notifications/components/web/Notification.js
similarity index 97%
rename from react/features/notifications/components/Notification.web.js
rename to react/features/notifications/components/web/Notification.js
index b2cea70925..b21c0f988e 100644
--- a/react/features/notifications/components/Notification.web.js
+++ b/react/features/notifications/components/web/Notification.js
@@ -7,13 +7,13 @@ import WarningIcon from '@atlaskit/icon/glyph/warning';
import { colors } from '@atlaskit/theme';
import React from 'react';
-import { translate } from '../../base/i18n';
+import { translate } from '../../../base/i18n';
-import { NOTIFICATION_TYPE } from '../constants';
+import { NOTIFICATION_TYPE } from '../../constants';
import AbstractNotification, {
type Props
-} from './AbstractNotification';
+} from '../AbstractNotification';
declare var interfaceConfig: Object;
diff --git a/react/features/notifications/components/NotificationsContainer.web.js b/react/features/notifications/components/web/NotificationsContainer.js
similarity index 94%
rename from react/features/notifications/components/NotificationsContainer.web.js
rename to react/features/notifications/components/web/NotificationsContainer.js
index 1207726807..822cca3dd3 100644
--- a/react/features/notifications/components/NotificationsContainer.web.js
+++ b/react/features/notifications/components/web/NotificationsContainer.js
@@ -3,12 +3,13 @@
import { FlagGroup } from '@atlaskit/flag';
import React from 'react';
-import { connect } from '../../base/redux';
+import { connect } from '../../../base/redux';
import AbstractNotificationsContainer, {
_abstractMapStateToProps as _mapStateToProps,
type Props
-} from './AbstractNotificationsContainer';
+} from '../AbstractNotificationsContainer';
+
import Notification from './Notification';
/**
diff --git a/react/features/notifications/components/web/index.js b/react/features/notifications/components/web/index.js
new file mode 100644
index 0000000000..0f33b32643
--- /dev/null
+++ b/react/features/notifications/components/web/index.js
@@ -0,0 +1,4 @@
+// @flow
+
+export { default as Notification } from './Notification';
+export { default as NotificationsContainer } from './NotificationsContainer';
diff --git a/react/features/notifications/constants.js b/react/features/notifications/constants.js
index f1a0706483..38ade8b8bc 100644
--- a/react/features/notifications/constants.js
+++ b/react/features/notifications/constants.js
@@ -1,3 +1,5 @@
+// @flow
+
/**
* The set of possible notification types.
*
diff --git a/react/features/notifications/functions.js b/react/features/notifications/functions.js
index 1f06858d65..2d1de4fdc6 100644
--- a/react/features/notifications/functions.js
+++ b/react/features/notifications/functions.js
@@ -1,3 +1,5 @@
+// @flow
+
import { toState } from '../base/redux';
/**
@@ -7,7 +9,7 @@ import { toState } from '../base/redux';
* @param {Object|Function} stateful - The redux store state.
* @returns {boolean}
*/
-export function areThereNotifications(stateful) {
+export function areThereNotifications(stateful: Object | Function) {
const state = toState(stateful);
const { enabled, notifications } = state['features/notifications'];
diff --git a/react/features/notifications/index.js b/react/features/notifications/index.js
index 44000a1a7b..e00e0841f1 100644
--- a/react/features/notifications/index.js
+++ b/react/features/notifications/index.js
@@ -1,3 +1,5 @@
+// @flow
+
export * from './actions';
export * from './actionTypes';
export * from './components';
diff --git a/react/features/notifications/reducer.js b/react/features/notifications/reducer.js
index bce909b175..62380ee376 100644
--- a/react/features/notifications/reducer.js
+++ b/react/features/notifications/reducer.js
@@ -1,3 +1,5 @@
+// @flow
+
import { ReducerRegistry } from '../base/redux';
import {