@tecsinapse/react-native-kit 4.0.0-beta.6 → 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.
|
@@ -30,15 +30,6 @@ const ModalView = ({
|
|
|
30
30
|
const translationCarrier = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
31
31
|
const opacityCarrier = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
32
32
|
const offset = isLastShown && keyboardOpened > 0 ? 0 : bottom;
|
|
33
|
-
const getKeyboardHeight = (keyboard) => {
|
|
34
|
-
if (keyboard === 0) return 0;
|
|
35
|
-
const wHeight = Math.ceil(reactNative.Dimensions.get("window").height);
|
|
36
|
-
const sHeight = Math.ceil(reactNative.Dimensions.get("screen").height);
|
|
37
|
-
if (wHeight !== sHeight) {
|
|
38
|
-
return keyboard + (sHeight - wHeight - (reactNative.StatusBar.currentHeight || 0));
|
|
39
|
-
}
|
|
40
|
-
return keyboard;
|
|
41
|
-
};
|
|
42
33
|
const show = React.useCallback(() => {
|
|
43
34
|
reactNative.Animated.sequence([
|
|
44
35
|
reactNative.Animated.timing(backgroundCarrier, {
|
|
@@ -128,8 +119,7 @@ const ModalView = ({
|
|
|
128
119
|
{
|
|
129
120
|
opacity: opacityCarrier,
|
|
130
121
|
transform: [{ translateY: translationCarrier }]
|
|
131
|
-
}
|
|
132
|
-
isLastShown && isRaiseKeyboard ? { paddingBottom: getKeyboardHeight(keyboardOpened) } : null
|
|
122
|
+
}
|
|
133
123
|
],
|
|
134
124
|
[opacityCarrier, translationCarrier, isLastShown, isRaiseKeyboard, keyboardOpened]
|
|
135
125
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { BoxContent } from '@tecsinapse/react-core';
|
|
3
3
|
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
4
|
-
import { Animated, Easing, Keyboard, Pressable
|
|
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';
|
|
7
7
|
|
|
@@ -28,15 +28,6 @@ const ModalView = ({
|
|
|
28
28
|
const translationCarrier = useRef(new Animated.Value(0)).current;
|
|
29
29
|
const opacityCarrier = useRef(new Animated.Value(0)).current;
|
|
30
30
|
const offset = isLastShown && keyboardOpened > 0 ? 0 : bottom;
|
|
31
|
-
const getKeyboardHeight = (keyboard) => {
|
|
32
|
-
if (keyboard === 0) return 0;
|
|
33
|
-
const wHeight = Math.ceil(Dimensions.get("window").height);
|
|
34
|
-
const sHeight = Math.ceil(Dimensions.get("screen").height);
|
|
35
|
-
if (wHeight !== sHeight) {
|
|
36
|
-
return keyboard + (sHeight - wHeight - (StatusBar.currentHeight || 0));
|
|
37
|
-
}
|
|
38
|
-
return keyboard;
|
|
39
|
-
};
|
|
40
31
|
const show = useCallback(() => {
|
|
41
32
|
Animated.sequence([
|
|
42
33
|
Animated.timing(backgroundCarrier, {
|
|
@@ -126,8 +117,7 @@ const ModalView = ({
|
|
|
126
117
|
{
|
|
127
118
|
opacity: opacityCarrier,
|
|
128
119
|
transform: [{ translateY: translationCarrier }]
|
|
129
|
-
}
|
|
130
|
-
isLastShown && isRaiseKeyboard ? { paddingBottom: getKeyboardHeight(keyboardOpened) } : null
|
|
120
|
+
}
|
|
131
121
|
],
|
|
132
122
|
[opacityCarrier, translationCarrier, isLastShown, isRaiseKeyboard, keyboardOpened]
|
|
133
123
|
);
|
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",
|
|
@@ -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
|
}
|