ui-rn 2.0.8 → 2.0.9
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/Example.tsx +1 -3
- package/package.json +1 -1
- package/src/Layout.tsx +21 -16
- package/src/index.tsx +1 -0
package/Example.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet, View } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { Text, Block, Icon } from './
|
|
3
|
+
import { Text, Block, Icon } from './src'
|
|
4
4
|
|
|
5
5
|
export default function Example() {
|
|
6
6
|
return (
|
|
@@ -11,5 +11,3 @@ export default function Example() {
|
|
|
11
11
|
</View>
|
|
12
12
|
)
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
const styles = StyleSheet.create({})
|
package/package.json
CHANGED
package/src/Layout.tsx
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import SafeAreaView, { ForceInsetProp } from
|
|
3
|
-
import { StyleProp, ViewStyle } from
|
|
4
|
-
export interface
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SafeAreaView, { ForceInsetProp } from 'react-native-safe-area-view';
|
|
3
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
export interface ILayout {
|
|
5
5
|
children?: any;
|
|
6
6
|
forceInset?: ForceInsetProp;
|
|
7
7
|
forceInsetBot?: ForceInsetProp;
|
|
8
|
-
|
|
8
|
+
styleBottom?: StyleProp<ViewStyle> | undefined;
|
|
9
9
|
style?: StyleProp<ViewStyle> | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
primary?: string;
|
|
11
|
+
bottomInset?: boolean;
|
|
12
|
+
|
|
12
13
|
}
|
|
13
14
|
export default function Layout({
|
|
14
15
|
children,
|
|
15
|
-
forceInset = { top:
|
|
16
|
-
forceInsetBot = { vertical:
|
|
17
|
-
|
|
16
|
+
forceInset = { top: 'always', horizontal: 'never', bottom: 'never' },
|
|
17
|
+
forceInsetBot = { vertical: 'never' },
|
|
18
|
+
styleBottom,
|
|
18
19
|
style,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
primary,
|
|
21
|
+
bottomInset
|
|
22
|
+
}: ILayout) {
|
|
22
23
|
return (
|
|
23
24
|
<SafeAreaView
|
|
24
25
|
style={[
|
|
@@ -26,6 +27,9 @@ export default function Layout({
|
|
|
26
27
|
flex: 1,
|
|
27
28
|
},
|
|
28
29
|
style,
|
|
30
|
+
primary && {
|
|
31
|
+
backgroundColor: primary
|
|
32
|
+
}
|
|
29
33
|
]}
|
|
30
34
|
forceInset={forceInset}
|
|
31
35
|
>
|
|
@@ -33,13 +37,14 @@ export default function Layout({
|
|
|
33
37
|
style={[
|
|
34
38
|
{
|
|
35
39
|
flex: 1,
|
|
40
|
+
backgroundColor: 'white'
|
|
36
41
|
},
|
|
37
|
-
|
|
42
|
+
styleBottom,
|
|
38
43
|
]}
|
|
39
|
-
forceInset={forceInsetBot}
|
|
44
|
+
forceInset={{ ...(bottomInset || styleBottom) && { vertical: 'never', bottom: 'always' }, ...forceInsetBot }}
|
|
40
45
|
>
|
|
41
46
|
{children}
|
|
42
47
|
</SafeAreaView>
|
|
43
|
-
</SafeAreaView>
|
|
48
|
+
</SafeAreaView >
|
|
44
49
|
);
|
|
45
50
|
}
|
package/src/index.tsx
CHANGED