@applicaster/quick-brick-core 13.0.0-alpha.3003916059 → 13.0.0-alpha.3013095924
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.
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { LayoutChangeEvent,
|
|
2
|
+
import { LayoutChangeEvent, StyleSheet, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { Handle, HandleProps } from "./Handle";
|
|
5
5
|
import { DraggableBottomSheet } from "./DraggableBottomSheet";
|
|
6
6
|
import {
|
|
7
7
|
SafeAreaView,
|
|
8
|
-
useSafeAreaFrame,
|
|
9
8
|
useSafeAreaInsets,
|
|
10
9
|
} from "react-native-safe-area-context";
|
|
11
10
|
import {
|
|
@@ -42,16 +41,17 @@ const defaultBottomOffset = platformSelect({
|
|
|
42
41
|
android: 0,
|
|
43
42
|
});
|
|
44
43
|
|
|
45
|
-
const getSheetHeight = ({ height, bottomOffset, maxHeight }) => {
|
|
44
|
+
const getSheetHeight = ({ height, bottomOffset, maxHeight, dimensions }) => {
|
|
46
45
|
return platformSelect({
|
|
47
46
|
ios: height - bottomOffset,
|
|
48
47
|
default:
|
|
49
|
-
(
|
|
50
|
-
|
|
48
|
+
!isAndroidVersionAtLeast(35) && isAndroidPlatform()
|
|
49
|
+
? (height || maxHeight) - (bottomOffset + dimensions.statusBarHeight)
|
|
50
|
+
: height || maxHeight,
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const useGetSheetHeight = (height, maxHeight) => {
|
|
54
|
+
const useGetSheetHeight = (height, maxHeight, dimensions) => {
|
|
55
55
|
const { bottom = defaultBottomOffset } = useSafeAreaInsets();
|
|
56
56
|
|
|
57
57
|
const bottomOffset = bottom;
|
|
@@ -60,6 +60,7 @@ const useGetSheetHeight = (height, maxHeight) => {
|
|
|
60
60
|
height,
|
|
61
61
|
bottomOffset,
|
|
62
62
|
maxHeight,
|
|
63
|
+
dimensions,
|
|
63
64
|
});
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -75,14 +76,12 @@ export function ModalBottomSheetFrame(props: Props) {
|
|
|
75
76
|
dimensions,
|
|
76
77
|
} = props;
|
|
77
78
|
|
|
78
|
-
const safeAreaDims = useSafeAreaFrame();
|
|
79
|
-
|
|
80
79
|
const extraStyles = {
|
|
81
80
|
backgroundColor,
|
|
82
81
|
borderTopLeftRadius: cornerRadius,
|
|
83
82
|
borderTopRightRadius: cornerRadius,
|
|
84
83
|
maxHeight,
|
|
85
|
-
maxWidth: Math.min(Number(maxWidth),
|
|
84
|
+
maxWidth: Math.min(Number(maxWidth), dimensions.width),
|
|
86
85
|
};
|
|
87
86
|
|
|
88
87
|
const [height, setHeight] = React.useState(0);
|
|
@@ -97,7 +96,9 @@ export function ModalBottomSheetFrame(props: Props) {
|
|
|
97
96
|
|
|
98
97
|
const { bottom = defaultBottomOffset } = useSafeAreaInsets();
|
|
99
98
|
|
|
100
|
-
const
|
|
99
|
+
const bottomOffset = bottom;
|
|
100
|
+
|
|
101
|
+
const sheetHeight = useGetSheetHeight(height, maxHeight, dimensions);
|
|
101
102
|
|
|
102
103
|
return (
|
|
103
104
|
<DraggableBottomSheet
|
|
@@ -108,7 +109,7 @@ export function ModalBottomSheetFrame(props: Props) {
|
|
|
108
109
|
header={(dragging) => <Handle {...handleProps} focused={dragging} />}
|
|
109
110
|
maxWidth={maxWidth}
|
|
110
111
|
{...dimensions}
|
|
111
|
-
height={
|
|
112
|
+
height={dimensions.height - bottomOffset}
|
|
112
113
|
>
|
|
113
114
|
<SafeAreaView
|
|
114
115
|
edges={["left", "right", "bottom"]}
|
package/App/index.tsx
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.3013095924",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "13.0.0-alpha.
|
|
32
|
-
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.
|
|
33
|
-
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.3013095924",
|
|
32
|
+
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.3013095924",
|
|
33
|
+
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.3013095924",
|
|
34
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3013095924",
|
|
35
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.3013095924",
|
|
36
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.3013095924",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.3013095924",
|
|
38
38
|
"atob": "^2.1.2",
|
|
39
39
|
"axios": "^0.28.0",
|
|
40
40
|
"btoa": "^1.2.1",
|