ui-rn 2.0.8 → 2.1.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.
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 './dist'
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-rn",
3
- "version": "2.0.8",
3
+ "version": "2.1.0",
4
4
  "repository": "https://github.com/package-dev/ui-rn",
5
5
  "description": "ui-rn",
6
6
  "author": "Phamha98",
@@ -45,14 +45,13 @@ export default class IconApp extends React.PureComponent<Props> {
45
45
  name: "home",
46
46
  };
47
47
 
48
- res: { color: string; style: any; size: number };
49
-
50
48
  constructor(props: Props) {
51
49
  super(props);
52
50
  this.res = makeProps(props);
53
51
  }
54
52
  render() {
55
- const { size, color, style } = this.res;
53
+ const res = makeProps(this.props);
54
+ const { size, color, style } = res;
56
55
  if (this.props.name === "none") return null;
57
56
  const IconView = RNVectorIcon[this.props.type || "Ionicons"];
58
57
  if (typeof this.props.onPress != "function") {
package/src/Layout.tsx CHANGED
@@ -1,24 +1,25 @@
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 LayoutAppProps {
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
- styleBot?: StyleProp<ViewStyle> | undefined;
8
+ styleBottom?: StyleProp<ViewStyle> | undefined;
9
9
  style?: StyleProp<ViewStyle> | undefined;
10
- isBack?: boolean;
11
- disable?: boolean;
10
+ primary?: string;
11
+ bottomInset?: boolean;
12
+
12
13
  }
13
14
  export default function Layout({
14
15
  children,
15
- forceInset = { top: "always", horizontal: "never", bottom: "never" },
16
- forceInsetBot = { vertical: "never" },
17
- styleBot,
16
+ forceInset = { top: 'always', horizontal: 'never', bottom: 'never' },
17
+ forceInsetBot = { vertical: 'never' },
18
+ styleBottom,
18
19
  style,
19
- disable,
20
- }: LayoutAppProps) {
21
- if (disable) return <>{children}</>;
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
- styleBot,
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
@@ -1,4 +1,5 @@
1
1
  export { default as Touch } from './Touch/Touch'
2
+ export { default as TouchScale } from './Touch/TouchScale'
2
3
  export { default as Block } from './Touch/Block'
3
4
  export { default as Text } from './Text'
4
5
  export { default as Icon } from './Icon'