Przeglądaj źródła

[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.
j8
Lyubo Marinov 8 lat temu
rodzic
commit
ca94563c51

+ 1
- 1
react/features/base/media/components/native/Video.js Wyświetl plik

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

+ 1
- 1
react/features/base/media/components/native/VideoTrack.js Wyświetl plik

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

+ 3
- 3
react/features/base/media/components/native/styles.js Wyświetl plik

@@ -1,15 +1,15 @@
1 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 6
 const video = {
7 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 14
     video
15 15
 });

+ 1
- 1
react/features/base/participants/components/ParticipantView.native.js Wyświetl plik

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

+ 3
- 3
react/features/base/participants/components/styles.js Wyświetl plik

@@ -1,11 +1,11 @@
1 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 10
     participantView: {
11 11
         alignItems: 'stretch',

+ 8
- 6
react/features/conference/components/Conference.native.js Wyświetl plik

@@ -9,7 +9,7 @@ import { LargeVideo } from '../../large-video';
9 9
 import { OverlayContainer } from '../../overlay';
10 10
 import { setToolboxVisible, Toolbox } from '../../toolbox';
11 11
 
12
-import { styles } from './styles';
12
+import styles from './styles';
13 13
 
14 14
 /**
15 15
  * The timeout in milliseconds after which the Toolbox will be hidden.
@@ -145,19 +145,21 @@ class Conference extends Component {
145 145
                   */}
146 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 155
                   * The Toolbox is in a stacking layer above the Filmstrip.
150 156
                   */}
151 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 162
                 <DialogContainer />
160
-                <OverlayContainer />
161 163
             </Container>
162 164
         );
163 165
     }

+ 3
- 3
react/features/conference/components/styles.js Wyświetl plik

@@ -5,11 +5,11 @@ import {
5 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 14
     conference: fixAndroidViewClipping({
15 15
         alignSelf: 'stretch',

+ 1
- 1
react/features/filmstrip/components/native/AudioMutedIndicator.js Wyświetl plik

@@ -1,7 +1,7 @@
1 1
 import React, { Component } from 'react';
2 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 7
  * Thumbnail badge for displaying the audio mute status of a participant.

+ 1
- 1
react/features/filmstrip/components/native/DominantSpeakerIndicator.js Wyświetl plik

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
2 2
 import { View } from 'react-native';
3 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 8
  * Thumbnail badge showing that the participant is the dominant speaker in

+ 1
- 1
react/features/filmstrip/components/native/ModeratorIndicator.js Wyświetl plik

@@ -1,7 +1,7 @@
1 1
 import React, { Component } from 'react';
2 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 7
  * Thumbnail badge showing that the participant is a conference moderator.

+ 1
- 1
react/features/filmstrip/components/native/VideoMutedIndicator.js Wyświetl plik

@@ -1,7 +1,7 @@
1 1
 import React, { Component } from 'react';
2 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 7
  * Thumbnail badge for displaying the video mute status of a participant.

+ 1
- 1
react/features/filmstrip/components/native/index.js Wyświetl plik

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

+ 3
- 3
react/features/filmstrip/components/native/styles.js Wyświetl plik

@@ -1,6 +1,6 @@
1 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 6
  * The base/default style of indicators such as audioMutedIndicator,
@@ -15,9 +15,9 @@ const indicator = {
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 23
      * Audio muted indicator style.

+ 2
- 2
react/features/filmstrip/components/styles.js Wyświetl plik

@@ -2,9 +2,9 @@ import { Platform } from '../../base/react';
2 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 9
      * Avatar style.
10 10
      */

+ 1
- 1
react/features/large-video/components/LargeVideo.native.js Wyświetl plik

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

+ 1
- 1
react/features/large-video/components/styles.js Wyświetl plik

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

+ 1
- 1
react/features/toolbox/components/Toolbox.native.js Wyświetl plik

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

+ 1
- 1
react/features/toolbox/components/styles.js Wyświetl plik

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

+ 1
- 1
react/features/welcome/components/WelcomePage.native.js Wyświetl plik

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

+ 1
- 1
react/features/welcome/components/styles.js Wyświetl plik

@@ -13,7 +13,7 @@ const TEXT_COLOR = ColorPalette.white;
13 13
 /**
14 14
  * The styles of WelcomePage.
15 15
  */
16
-export const styles = createStyleSheet({
16
+export default createStyleSheet({
17 17
     /**
18 18
      * Join button style.
19 19
      */

Ładowanie…
Anuluj
Zapisz