@popp0102/nova 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Screen/index.js +15 -14
- package/package.json +1 -1
|
@@ -3,14 +3,10 @@ import { SafeAreaView } from 'react-native-safe-area-context';
|
|
|
3
3
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
4
|
|
|
5
5
|
export default function Screen({ style, children, gradientColors, backgroundImage }) {
|
|
6
|
-
const
|
|
7
|
-
<
|
|
6
|
+
const content = (
|
|
7
|
+
<SafeAreaView style={[styles.safeArea, style]}>
|
|
8
8
|
{children}
|
|
9
|
-
</
|
|
10
|
-
) : (
|
|
11
|
-
<View style={styles.gradient}>
|
|
12
|
-
{children}
|
|
13
|
-
</View>
|
|
9
|
+
</SafeAreaView>
|
|
14
10
|
);
|
|
15
11
|
|
|
16
12
|
const withBackground = backgroundImage ? (
|
|
@@ -20,16 +16,21 @@ export default function Screen({ style, children, gradientColors, backgroundImag
|
|
|
20
16
|
imageStyle={{ opacity: backgroundImage.opacity ?? 0.1 }}
|
|
21
17
|
resizeMode="cover"
|
|
22
18
|
>
|
|
23
|
-
{
|
|
19
|
+
{content}
|
|
24
20
|
</ImageBackground>
|
|
25
|
-
) :
|
|
26
|
-
gradientOrView
|
|
27
|
-
);
|
|
21
|
+
) : content;
|
|
28
22
|
|
|
29
|
-
return (
|
|
30
|
-
<
|
|
23
|
+
return gradientColors ? (
|
|
24
|
+
<LinearGradient
|
|
25
|
+
colors={gradientColors}
|
|
26
|
+
style={styles.gradient}
|
|
27
|
+
>
|
|
31
28
|
{withBackground}
|
|
32
|
-
</
|
|
29
|
+
</LinearGradient>
|
|
30
|
+
) : (
|
|
31
|
+
<View style={styles.gradient}>
|
|
32
|
+
{withBackground}
|
|
33
|
+
</View>
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
36
|
|