Sfoglia il codice sorgente

[RN] Make BaseIndicator render simpler

master
Bettenbuk Zoltan 6 anni fa
parent
commit
b791fc32fd

+ 6
- 13
react/features/filmstrip/components/native/BaseIndicator.js Vedi File

33
     render() {
33
     render() {
34
         const { highlight, icon } = this.props;
34
         const { highlight, icon } = this.props;
35
 
35
 
36
-        const iconElement = (<Icon
37
-            name = { icon }
38
-            style = { styles.indicator } />
36
+        return (
37
+            <View style = { highlight ? styles.highlightedIndicator : null }>
38
+                <Icon
39
+                    name = { icon }
40
+                    style = { styles.indicator } />
41
+            </View>
39
         );
42
         );
40
-
41
-        if (highlight) {
42
-            return (
43
-                <View style = { styles.indicatorBackground }>
44
-                    { iconElement }
45
-                </View>
46
-            );
47
-        }
48
-
49
-        return iconElement;
50
     }
43
     }
51
 }
44
 }

+ 9
- 13
react/features/filmstrip/components/native/styles.js Vedi File

14
  * The styles of the feature filmstrip.
14
  * The styles of the feature filmstrip.
15
  */
15
  */
16
 export default {
16
 export default {
17
+    /**
18
+     * Highlighted indicator additional style.
19
+     */
20
+    highlightedIndicator: {
21
+        backgroundColor: ColorPalette.blue,
22
+        borderRadius: 16,
23
+        padding: 4
24
+    },
25
+
17
     /**
26
     /**
18
      * Dominant speaker indicator style.
27
      * Dominant speaker indicator style.
19
      */
28
      */
28
         }
37
         }
29
     },
38
     },
30
 
39
 
31
-    /**
32
-     * Dominant speaker indicator background style.
33
-     */
34
-    indicatorBackground: {
35
-        alignItems: 'center',
36
-        backgroundColor: ColorPalette.blue,
37
-        borderRadius: 16,
38
-        flexDirection: 'row',
39
-        justifyContent: 'center',
40
-        height: 20,
41
-        width: 20
42
-    },
43
-
44
     /**
40
     /**
45
      * The style of the narrow {@link Filmstrip} version which displays
41
      * The style of the narrow {@link Filmstrip} version which displays
46
      * thumbnails in a row at the bottom of the screen.
42
      * thumbnails in a row at the bottom of the screen.

Loading…
Annulla
Salva