@applicaster/quick-brick-core 13.0.0-rc.115 → 13.0.0-rc.117

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,9 +1,13 @@
1
1
  import React from "react";
2
- import { LayoutChangeEvent, StyleSheet, View } from "react-native";
2
+ import { LayoutChangeEvent, Platform, StyleSheet, View } from "react-native";
3
3
 
4
4
  import { Handle, HandleProps } from "./Handle";
5
5
  import { DraggableBottomSheet } from "./DraggableBottomSheet";
6
- import { SafeAreaView } from "react-native-safe-area-context";
6
+ import {
7
+ SafeAreaView,
8
+ useSafeAreaInsets,
9
+ } from "react-native-safe-area-context";
10
+ import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
7
11
 
8
12
  type Props = {
9
13
  children: React.ReactChild;
@@ -14,7 +18,11 @@ type Props = {
14
18
  visible: boolean;
15
19
  handleProps: HandleProps;
16
20
  closeToast: () => void;
17
- dimensions: { width: number; height: number };
21
+ dimensions: {
22
+ statusBarHeight: any;
23
+ width: number;
24
+ height: number;
25
+ };
18
26
  };
19
27
 
20
28
  const styles = StyleSheet.create({
@@ -24,6 +32,11 @@ const styles = StyleSheet.create({
24
32
  },
25
33
  });
26
34
 
35
+ const defaultBottomOffset = platformSelect({
36
+ ios: 34,
37
+ android: 0,
38
+ });
39
+
27
40
  export function ModalBottomSheetFrame(props: Props) {
28
41
  const {
29
42
  children,
@@ -54,9 +67,15 @@ export function ModalBottomSheetFrame(props: Props) {
54
67
  }
55
68
  };
56
69
 
70
+ const { bottom = defaultBottomOffset } = useSafeAreaInsets();
71
+
72
+ const bottomOffset = bottom + dimensions.statusBarHeight;
73
+
57
74
  return (
58
75
  <DraggableBottomSheet
59
- sheetHeight={height}
76
+ sheetHeight={
77
+ Platform.OS === "ios" ? height : (height || maxHeight) - bottomOffset
78
+ }
60
79
  visible={visible}
61
80
  dismiss={props.closeToast}
62
81
  hasHeader={handleProps.enabled}
@@ -67,9 +86,8 @@ export function ModalBottomSheetFrame(props: Props) {
67
86
  <SafeAreaView
68
87
  edges={["left", "right", "bottom"]}
69
88
  style={[styles.toastFrameContainer, extraStyles]}
70
- onLayout={onLayout}
71
89
  >
72
- <View>{children}</View>
90
+ <View onLayout={onLayout}>{children}</View>
73
91
  </SafeAreaView>
74
92
  </DraggableBottomSheet>
75
93
  );
@@ -4,7 +4,7 @@ import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils"
4
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
5
 
6
6
  import React, { useEffect, useState } from "react";
7
- import { Keyboard, StyleSheet, View } from "react-native";
7
+ import { Keyboard, Platform, StyleSheet, View } from "react-native";
8
8
 
9
9
  import { Overlay } from "./Overlay";
10
10
  import { ModalBottomSheetFrame } from "./ModalBottomSheetFrame";
@@ -79,7 +79,9 @@ export function ModalBottomSheet(props: Props) {
79
79
  <ModalBottomSheetFrame
80
80
  backgroundColor={sheetBackgroundColor}
81
81
  cornerRadius={sheetCornerRadius}
82
- maxHeight={sheetMaxHeight + bottomOffset}
82
+ maxHeight={
83
+ Platform.OS === "ios" ? sheetMaxHeight + bottomOffset : sheetMaxHeight
84
+ }
83
85
  maxWidth={maxWidth}
84
86
  dimensions={dimensions}
85
87
  visible={visible}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "13.0.0-rc.115",
3
+ "version": "13.0.0-rc.117",
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-rc.115",
32
- "@applicaster/quick-brick-core-plugins": "13.0.0-rc.115",
33
- "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.115",
34
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.115",
35
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.115",
36
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.115",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.115",
31
+ "@applicaster/applicaster-types": "13.0.0-rc.117",
32
+ "@applicaster/quick-brick-core-plugins": "13.0.0-rc.117",
33
+ "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.117",
34
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.117",
35
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.117",
36
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.117",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.117",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",