Pārlūkot izejas kodu

[RN] Coding style

The files styles.js are used (pretty much) on React Native only and each
of them exports 1 name. Export it as default to cut down on source code.
master
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
ca94563c51

+ 1
- 1
react/features/base/media/components/native/Video.js Parādīt failu

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { RTCView } from 'react-native-webrtc';
4
 import { RTCView } from 'react-native-webrtc';
5
 
5
 
6
-import { styles } from './styles';
6
+import styles from './styles';
7
 
7
 
8
 /**
8
 /**
9
  * The React Native {@link Component} which is similar to Web's
9
  * The React Native {@link Component} which is similar to Web's

+ 1
- 1
react/features/base/media/components/native/VideoTrack.js Parādīt failu

3
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
4
 
4
 
5
 import AbstractVideoTrack from '../AbstractVideoTrack';
5
 import AbstractVideoTrack from '../AbstractVideoTrack';
6
-import { styles } from './styles';
6
+import styles from './styles';
7
 
7
 
8
 /**
8
 /**
9
  * Component that renders video element for a specified video track.
9
  * Component that renders video element for a specified video track.

+ 3
- 3
react/features/base/media/components/native/styles.js Parādīt failu

1
 import { StyleSheet } from 'react-native';
1
 import { StyleSheet } from 'react-native';
2
 
2
 
3
 /**
3
 /**
4
- * Make video element fill its container.
4
+ * Make {@code Video} fill its container.
5
  */
5
  */
6
 const video = {
6
 const video = {
7
     flex: 1
7
     flex: 1
8
 };
8
 };
9
 
9
 
10
 /**
10
 /**
11
- * Native-specific styles for media components.
11
+ * The styles of the feature base/media.
12
  */
12
  */
13
-export const styles = StyleSheet.create({
13
+export default StyleSheet.create({
14
     video
14
     video
15
 });
15
 });

+ 1
- 1
react/features/base/participants/components/ParticipantView.native.js Parādīt failu

12
 
12
 
13
 import Avatar from './Avatar';
13
 import Avatar from './Avatar';
14
 import { getAvatarURL, getParticipantById } from '../functions';
14
 import { getAvatarURL, getParticipantById } from '../functions';
15
-import { styles } from './styles';
15
+import styles from './styles';
16
 
16
 
17
 /**
17
 /**
18
  * Implements a React Component which depicts a specific participant's avatar
18
  * Implements a React Component which depicts a specific participant's avatar

+ 3
- 3
react/features/base/participants/components/styles.js Parādīt failu

1
 import { createStyleSheet } from '../../styles';
1
 import { createStyleSheet } from '../../styles';
2
 
2
 
3
 /**
3
 /**
4
- * The style of the avatar and participant view UI (components).
4
+ * The styles of the feature base/participants.
5
  */
5
  */
6
-export const styles = createStyleSheet({
6
+export default createStyleSheet({
7
     /**
7
     /**
8
-     * ParticipantView style.
8
+     * {@code ParticipantView} style.
9
      */
9
      */
10
     participantView: {
10
     participantView: {
11
         alignItems: 'stretch',
11
         alignItems: 'stretch',

+ 8
- 6
react/features/conference/components/Conference.native.js Parādīt failu

9
 import { OverlayContainer } from '../../overlay';
9
 import { OverlayContainer } from '../../overlay';
10
 import { setToolboxVisible, Toolbox } from '../../toolbox';
10
 import { setToolboxVisible, Toolbox } from '../../toolbox';
11
 
11
 
12
-import { styles } from './styles';
12
+import styles from './styles';
13
 
13
 
14
 /**
14
 /**
15
  * The timeout in milliseconds after which the Toolbox will be hidden.
15
  * The timeout in milliseconds after which the Toolbox will be hidden.
145
                   */}
145
                   */}
146
                 <Filmstrip />
146
                 <Filmstrip />
147
 
147
 
148
+                {/*
149
+                  * The overlays need to be bellow the Toolbox so that the user
150
+                  * may tap the ToolbarButtons.
151
+                  */}
152
+                <OverlayContainer />
153
+
148
                 {/*
154
                 {/*
149
                   * The Toolbox is in a stacking layer above the Filmstrip.
155
                   * The Toolbox is in a stacking layer above the Filmstrip.
150
                   */}
156
                   */}
151
                 <Toolbox />
157
                 <Toolbox />
152
 
158
 
153
                 {/*
159
                 {/*
154
-                  * The dialogs and overlays are in the topmost stacking layers.
155
-                  * Generally, the dialogs and overlays should not be visible at
156
-                  * the same time so it is not really defined which one is above
157
-                  * the other.
160
+                  * The dialogs are in the topmost stacking layers.
158
                   */}
161
                   */}
159
                 <DialogContainer />
162
                 <DialogContainer />
160
-                <OverlayContainer />
161
             </Container>
163
             </Container>
162
         );
164
         );
163
     }
165
     }

+ 3
- 3
react/features/conference/components/styles.js Parādīt failu

5
 } from '../../base/styles';
5
 } from '../../base/styles';
6
 
6
 
7
 /**
7
 /**
8
- * The style of the conference UI (component).
8
+ * The styles of the feature conference.
9
  */
9
  */
10
-export const styles = createStyleSheet({
10
+export default createStyleSheet({
11
     /**
11
     /**
12
-     * Conference style.
12
+     * {@code Conference} style.
13
      */
13
      */
14
     conference: fixAndroidViewClipping({
14
     conference: fixAndroidViewClipping({
15
         alignSelf: 'stretch',
15
         alignSelf: 'stretch',

+ 1
- 1
react/features/filmstrip/components/native/AudioMutedIndicator.js Parādīt failu

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
3
 
3
 
4
-import { styles } from './styles';
4
+import styles from './styles';
5
 
5
 
6
 /**
6
 /**
7
  * Thumbnail badge for displaying the audio mute status of a participant.
7
  * Thumbnail badge for displaying the audio mute status of a participant.

+ 1
- 1
react/features/filmstrip/components/native/DominantSpeakerIndicator.js Parādīt failu

2
 import { View } from 'react-native';
2
 import { View } from 'react-native';
3
 import Icon from 'react-native-vector-icons/FontAwesome';
3
 import Icon from 'react-native-vector-icons/FontAwesome';
4
 
4
 
5
-import { styles } from './styles';
5
+import styles from './styles';
6
 
6
 
7
 /**
7
 /**
8
  * Thumbnail badge showing that the participant is the dominant speaker in
8
  * Thumbnail badge showing that the participant is the dominant speaker in

+ 1
- 1
react/features/filmstrip/components/native/ModeratorIndicator.js Parādīt failu

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
3
 
3
 
4
-import { styles } from './styles';
4
+import styles from './styles';
5
 
5
 
6
 /**
6
 /**
7
  * Thumbnail badge showing that the participant is a conference moderator.
7
  * Thumbnail badge showing that the participant is a conference moderator.

+ 1
- 1
react/features/filmstrip/components/native/VideoMutedIndicator.js Parādīt failu

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
2
 import Icon from 'react-native-vector-icons/FontAwesome';
3
 
3
 
4
-import { styles } from './styles';
4
+import styles from './styles';
5
 
5
 
6
 /**
6
 /**
7
  * Thumbnail badge for displaying the video mute status of a participant.
7
  * Thumbnail badge for displaying the video mute status of a participant.

+ 1
- 1
react/features/filmstrip/components/native/index.js Parādīt failu

1
 export * from './AudioMutedIndicator';
1
 export * from './AudioMutedIndicator';
2
 export * from './DominantSpeakerIndicator';
2
 export * from './DominantSpeakerIndicator';
3
 export * from './ModeratorIndicator';
3
 export * from './ModeratorIndicator';
4
-export * from './styles';
4
+export { default as styles } from './styles';
5
 export * from './VideoMutedIndicator';
5
 export * from './VideoMutedIndicator';

+ 3
- 3
react/features/filmstrip/components/native/styles.js Parādīt failu

1
 import { ColorPalette, createStyleSheet } from '../../../base/styles';
1
 import { ColorPalette, createStyleSheet } from '../../../base/styles';
2
 
2
 
3
-import { styles as platformIndependentStyles } from '../styles';
3
+import { default as platformIndependentStyles } from '../styles';
4
 
4
 
5
 /**
5
 /**
6
  * The base/default style of indicators such as audioMutedIndicator,
6
  * The base/default style of indicators such as audioMutedIndicator,
15
 };
15
 };
16
 
16
 
17
 /**
17
 /**
18
- * Native-specific styles for the filmstrip.
18
+ * The styles of the feature filmstrip.
19
  */
19
  */
20
-export const styles = createStyleSheet(platformIndependentStyles, {
20
+export default createStyleSheet(platformIndependentStyles, {
21
 
21
 
22
     /**
22
     /**
23
      * Audio muted indicator style.
23
      * Audio muted indicator style.

+ 2
- 2
react/features/filmstrip/components/styles.js Parādīt failu

2
 import { BoxModel, ColorPalette } from '../../base/styles';
2
 import { BoxModel, ColorPalette } from '../../base/styles';
3
 
3
 
4
 /**
4
 /**
5
- * Filmstrip related styles common to both Web and native.
5
+ * The styles of the feature filmstrip common to both Web and native.
6
  */
6
  */
7
-export const styles = {
7
+export default {
8
     /**
8
     /**
9
      * Avatar style.
9
      * Avatar style.
10
      */
10
      */

+ 1
- 1
react/features/large-video/components/LargeVideo.native.js Parādīt failu

5
 
5
 
6
 import { ParticipantView } from '../../base/participants';
6
 import { ParticipantView } from '../../base/participants';
7
 
7
 
8
-import { styles } from './styles';
8
+import styles from './styles';
9
 
9
 
10
 /**
10
 /**
11
  * Implements a React {@link Component} which represents the large video (a.k.a.
11
  * Implements a React {@link Component} which represents the large video (a.k.a.

+ 1
- 1
react/features/large-video/components/styles.js Parādīt failu

1
 import { ColorPalette, createStyleSheet } from '../../base/styles';
1
 import { ColorPalette, createStyleSheet } from '../../base/styles';
2
 
2
 
3
-export const styles = createStyleSheet({
3
+export default createStyleSheet({
4
     /**
4
     /**
5
      * The style of the avatar of the participant displayed in largeVideo. It's
5
      * The style of the avatar of the participant displayed in largeVideo. It's
6
      * an addition to the default style of Avatar.
6
      * an addition to the default style of Avatar.

+ 1
- 1
react/features/toolbox/components/Toolbox.native.js Parādīt failu

13
     abstractMapDispatchToProps,
13
     abstractMapDispatchToProps,
14
     abstractMapStateToProps
14
     abstractMapStateToProps
15
 } from '../functions';
15
 } from '../functions';
16
-import { styles } from './styles';
16
+import styles from './styles';
17
 import ToolbarButton from './ToolbarButton';
17
 import ToolbarButton from './ToolbarButton';
18
 
18
 
19
 /**
19
 /**

+ 1
- 1
react/features/toolbox/components/styles.js Parādīt failu

70
 /**
70
 /**
71
  * The (conference) Toolbox/Toolbar related styles.
71
  * The (conference) Toolbox/Toolbar related styles.
72
  */
72
  */
73
-export const styles = createStyleSheet({
73
+export default createStyleSheet({
74
     /**
74
     /**
75
      * The style of the toolbar button in {@link #primaryToolbar} which
75
      * The style of the toolbar button in {@link #primaryToolbar} which
76
      * hangs the current conference up.
76
      * hangs the current conference up.

+ 1
- 1
react/features/welcome/components/WelcomePage.native.js Parādīt failu

7
 import { ColorPalette } from '../../base/styles';
7
 import { ColorPalette } from '../../base/styles';
8
 
8
 
9
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
9
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
10
-import { styles } from './styles';
10
+import styles from './styles';
11
 
11
 
12
 /**
12
 /**
13
  * The URL at which the privacy policy is available to the user.
13
  * The URL at which the privacy policy is available to the user.

+ 1
- 1
react/features/welcome/components/styles.js Parādīt failu

13
 /**
13
 /**
14
  * The styles of WelcomePage.
14
  * The styles of WelcomePage.
15
  */
15
  */
16
-export const styles = createStyleSheet({
16
+export default createStyleSheet({
17
     /**
17
     /**
18
      * Join button style.
18
      * Join button style.
19
      */
19
      */

Notiek ielāde…
Atcelt
Saglabāt