@popp0102/nova 0.7.0 → 0.8.0

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.
@@ -0,0 +1,47 @@
1
+ import { StyleSheet, ImageBackground, View } from 'react-native';
2
+ import { SafeAreaView } from 'react-native-safe-area-context';
3
+ import { LinearGradient } from 'expo-linear-gradient';
4
+
5
+ export default function Screen({ style, children, gradientColors, backgroundImage }) {
6
+ const content = (
7
+ <SafeAreaView style={[styles.safeArea, style]}>
8
+ {children}
9
+ </SafeAreaView>
10
+ );
11
+
12
+ const withBackground = backgroundImage ? (
13
+ <ImageBackground
14
+ source={backgroundImage.source}
15
+ style={styles.backgroundImage}
16
+ imageStyle={{ opacity: backgroundImage.opacity ?? 0.1 }}
17
+ resizeMode="cover"
18
+ >
19
+ {content}
20
+ </ImageBackground>
21
+ ) : content;
22
+
23
+ return gradientColors ? (
24
+ <LinearGradient
25
+ colors={gradientColors}
26
+ style={styles.gradient}
27
+ >
28
+ {withBackground}
29
+ </LinearGradient>
30
+ ) : (
31
+ <View style={styles.gradient}>
32
+ {withBackground}
33
+ </View>
34
+ );
35
+ }
36
+
37
+ const styles = StyleSheet.create({
38
+ gradient: {
39
+ flex: 1,
40
+ },
41
+ backgroundImage: {
42
+ flex: 1,
43
+ },
44
+ safeArea: {
45
+ flex: 1,
46
+ },
47
+ });
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@ export { default as Modal } from './components/Modal';
3
3
  export { default as Badge } from './components/Badge';
4
4
  export { default as Card } from './components/Card';
5
5
  export { default as IconButton } from './components/IconButton';
6
+ export { default as Screen } from './components/Screen';
6
7
  export { default as Subtitle } from './components/Subtitle';
7
8
  export { default as Title } from './components/Title';
8
9
  export { default as FadeView } from './components/animations/FadeView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popp0102/nova",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "React Native component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",