@widergy/mobile-ui 1.11.6 → 1.12.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/CHANGELOG.md +7 -0
- package/lib/components/UTLoading/index.js +32 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.12.0](https://github.com/widergy/mobile-ui/compare/v1.11.6...v1.12.0) (2024-06-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* utloading prevent unmount ([#302](https://github.com/widergy/mobile-ui/issues/302)) ([00511a9](https://github.com/widergy/mobile-ui/commit/00511a91833ff5f8ba73c74a54eb0ba612d5c3b4))
|
|
7
|
+
|
|
1
8
|
## [1.11.6](https://github.com/widergy/mobile-ui/compare/v1.11.5...v1.11.6) (2024-06-25)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,35 +1,50 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
2
|
import { number, string, bool } from 'prop-types';
|
|
3
|
+
import { View } from 'react-native';
|
|
3
4
|
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
4
5
|
|
|
5
6
|
import Loading from '../Loading';
|
|
6
7
|
|
|
7
8
|
import styles from './styles';
|
|
8
9
|
|
|
9
|
-
const UTLoading = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const UTLoading = ({
|
|
11
|
+
children,
|
|
12
|
+
color,
|
|
13
|
+
loading,
|
|
14
|
+
message,
|
|
15
|
+
messageStyle,
|
|
16
|
+
preventUnmount,
|
|
17
|
+
size,
|
|
18
|
+
style,
|
|
19
|
+
thickness
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<Fragment>
|
|
23
|
+
{!!loading && (
|
|
24
|
+
<Loading
|
|
25
|
+
style={[styles.spinner, style]}
|
|
26
|
+
message={message}
|
|
27
|
+
color={color}
|
|
28
|
+
size={size}
|
|
29
|
+
thickness={thickness}
|
|
30
|
+
messageStyle={messageStyle}
|
|
31
|
+
/>
|
|
32
|
+
)}
|
|
33
|
+
{preventUnmount ? <View style={{ display: loading && 'none' }}>{children}</View> : !loading && children}
|
|
34
|
+
</Fragment>
|
|
22
35
|
);
|
|
36
|
+
};
|
|
23
37
|
|
|
24
38
|
UTLoading.displayName = 'UTLoading';
|
|
25
39
|
|
|
26
40
|
UTLoading.propTypes = {
|
|
27
|
-
|
|
28
|
-
messageStyle: ViewPropTypes.style,
|
|
41
|
+
color: string,
|
|
29
42
|
loading: bool,
|
|
30
43
|
message: string,
|
|
31
|
-
|
|
44
|
+
messageStyle: ViewPropTypes.style,
|
|
45
|
+
preventUnmount: bool,
|
|
32
46
|
size: number,
|
|
47
|
+
style: ViewPropTypes.style,
|
|
33
48
|
thickness: number
|
|
34
49
|
};
|
|
35
50
|
|
package/package.json
CHANGED