@tecsinapse/react-native-kit 4.0.0-beta.5 → 4.0.0-beta.7
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.
|
@@ -17,6 +17,7 @@ const ModalView = ({
|
|
|
17
17
|
BoxComponent = reactCore.BoxContent,
|
|
18
18
|
frozen,
|
|
19
19
|
isLastShown,
|
|
20
|
+
isRaiseKeyboard = true,
|
|
20
21
|
showCloseBar = true,
|
|
21
22
|
close,
|
|
22
23
|
onClose
|
|
@@ -113,13 +114,19 @@ const ModalView = ({
|
|
|
113
114
|
hideEvent.remove();
|
|
114
115
|
};
|
|
115
116
|
}, []);
|
|
117
|
+
const viewStyle = React.useMemo(
|
|
118
|
+
() => [
|
|
119
|
+
{
|
|
120
|
+
opacity: opacityCarrier,
|
|
121
|
+
transform: [{ translateY: translationCarrier }]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
[opacityCarrier, translationCarrier, isLastShown, isRaiseKeyboard, keyboardOpened]
|
|
125
|
+
);
|
|
116
126
|
return /* @__PURE__ */ jsxRuntime.jsx(styled.StyledPressableBackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(styled.BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
127
|
reactNative.Animated.View,
|
|
118
128
|
{
|
|
119
|
-
style:
|
|
120
|
-
opacity: opacityCarrier,
|
|
121
|
-
transform: [{ translateY: translationCarrier }]
|
|
122
|
-
},
|
|
129
|
+
style: viewStyle,
|
|
123
130
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
124
131
|
BoxComponent,
|
|
125
132
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { BoxContent } from '@tecsinapse/react-core';
|
|
3
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
4
4
|
import { Animated, Easing, Keyboard, Pressable } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { StyledPressableBackDrop, BackDropView, CloseBar } from './styled.js';
|
|
@@ -15,6 +15,7 @@ const ModalView = ({
|
|
|
15
15
|
BoxComponent = BoxContent,
|
|
16
16
|
frozen,
|
|
17
17
|
isLastShown,
|
|
18
|
+
isRaiseKeyboard = true,
|
|
18
19
|
showCloseBar = true,
|
|
19
20
|
close,
|
|
20
21
|
onClose
|
|
@@ -111,13 +112,19 @@ const ModalView = ({
|
|
|
111
112
|
hideEvent.remove();
|
|
112
113
|
};
|
|
113
114
|
}, []);
|
|
115
|
+
const viewStyle = useMemo(
|
|
116
|
+
() => [
|
|
117
|
+
{
|
|
118
|
+
opacity: opacityCarrier,
|
|
119
|
+
transform: [{ translateY: translationCarrier }]
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
[opacityCarrier, translationCarrier, isLastShown, isRaiseKeyboard, keyboardOpened]
|
|
123
|
+
);
|
|
114
124
|
return /* @__PURE__ */ jsx(StyledPressableBackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsx(BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsx(
|
|
115
125
|
Animated.View,
|
|
116
126
|
{
|
|
117
|
-
style:
|
|
118
|
-
opacity: opacityCarrier,
|
|
119
|
-
transform: [{ translateY: translationCarrier }]
|
|
120
|
-
},
|
|
127
|
+
style: viewStyle,
|
|
121
128
|
children: /* @__PURE__ */ jsx(Pressable, { children: /* @__PURE__ */ jsxs(
|
|
122
129
|
BoxComponent,
|
|
123
130
|
{
|
|
@@ -39,6 +39,7 @@ declare const useModal: <Data, Type extends SelectType>({ keyExtractor, labelExt
|
|
|
39
39
|
BoxComponent?: React.FC<any>;
|
|
40
40
|
frozen?: boolean;
|
|
41
41
|
isLastShown?: boolean;
|
|
42
|
+
isRaiseKeyboard?: boolean;
|
|
42
43
|
showCloseBar?: boolean;
|
|
43
44
|
onClose?: () => void;
|
|
44
45
|
children?: React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-native-kit",
|
|
3
3
|
"description": "React Native components library",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/native": "~11.11.0",
|
|
20
20
|
"@emotion/react": "~11.11.0",
|
|
21
|
-
"@tecsinapse/react-core": "4.0.0-beta.
|
|
21
|
+
"@tecsinapse/react-core": "4.0.0-beta.6",
|
|
22
22
|
"react-native-linear-gradient": "~2.8.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react-native-safe-area-context": "^4.0.0",
|
|
41
41
|
"react-native-vector-icons": "^9.2.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "cac03c8201921d4aa30850f0a4adb28b1d143e33"
|
|
44
44
|
}
|