@jobber/components-native 0.89.0 → 0.89.1-JOB-139857-e7771b4.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.
- package/dist/package.json +2 -2
- package/dist/src/BottomSheet/BottomSheet.js +2 -2
- package/dist/src/ContentOverlay/UNSAFE_WrappedModalize.js +4 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +1 -1
- package/package.json +2 -2
- package/src/BottomSheet/BottomSheet.tsx +4 -3
- package/src/ButtonGroup/ButtonGroup.test.tsx +6 -6
- package/src/ContentOverlay/UNSAFE_WrappedModalize.tsx +3 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { IHandles } from "react-native-modalize/lib/options";
|
|
3
|
-
export declare const UNSAFE_WrappedModalize: React.ForwardRefExoticComponent<Omit<import("react-native-modalize/lib/options").IProps<any> & React.RefAttributes<string | number | boolean | {} | React.ReactPortal | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | undefined>, "ref"> & React.RefAttributes<IHandles>>;
|
|
3
|
+
export declare const UNSAFE_WrappedModalize: React.ForwardRefExoticComponent<Omit<import("react-native-modalize/lib/options").IProps<any> & React.RefAttributes<string | number | boolean | {} | React.ReactPortal | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | undefined>, "ref"> & React.RefAttributes<IHandles | undefined>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.89.
|
|
3
|
+
"version": "0.89.1-JOB-139857-e7771b4.7+e7771b4e1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"react-native-safe-area-context": "^5.4.0",
|
|
95
95
|
"react-native-svg": ">=12.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "e7771b4e1b4363a1f41119579a03282032c2f1fe"
|
|
98
98
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, Ref, RefObject } from "react";
|
|
2
2
|
import React, { forwardRef, useState } from "react";
|
|
3
|
-
import { Modalize } from "react-native-modalize";
|
|
3
|
+
import type { Modalize } from "react-native-modalize";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { Keyboard, View } from "react-native";
|
|
6
6
|
import { BottomSheetOption } from "./components/BottomSheetOption";
|
|
7
7
|
import { useStyles } from "./BottomSheet.style";
|
|
8
|
+
import { UNSAFE_WrappedModalize } from "../ContentOverlay/UNSAFE_WrappedModalize";
|
|
8
9
|
import { useIsScreenReaderEnabled } from "../hooks";
|
|
9
10
|
import { Divider } from "../Divider";
|
|
10
11
|
import { Heading } from "../Heading";
|
|
@@ -61,7 +62,7 @@ function BottomSheetInternal(
|
|
|
61
62
|
return (
|
|
62
63
|
<>
|
|
63
64
|
{open && <Overlay styles={styles} />}
|
|
64
|
-
<
|
|
65
|
+
<UNSAFE_WrappedModalize
|
|
65
66
|
ref={ref}
|
|
66
67
|
adjustToContentHeight={true}
|
|
67
68
|
modalStyle={styles.modal}
|
|
@@ -90,7 +91,7 @@ function BottomSheetInternal(
|
|
|
90
91
|
>
|
|
91
92
|
{children}
|
|
92
93
|
</View>
|
|
93
|
-
</
|
|
94
|
+
</UNSAFE_WrappedModalize>
|
|
94
95
|
</>
|
|
95
96
|
);
|
|
96
97
|
|
|
@@ -172,7 +172,7 @@ it("opens the secondary action menu when the More button is pressed", () => {
|
|
|
172
172
|
const createAction = jest.fn();
|
|
173
173
|
const editAction = jest.fn();
|
|
174
174
|
const deleteAction = jest.fn();
|
|
175
|
-
const {
|
|
175
|
+
const { findByText, queryByText, getByLabelText } = render(
|
|
176
176
|
<ButtonGroupForTest>
|
|
177
177
|
<ButtonGroup.PrimaryAction
|
|
178
178
|
label="Create"
|
|
@@ -196,14 +196,14 @@ it("opens the secondary action menu when the More button is pressed", () => {
|
|
|
196
196
|
|
|
197
197
|
fireEvent.press(getByLabelText("More"));
|
|
198
198
|
|
|
199
|
-
expect(
|
|
200
|
-
expect(
|
|
199
|
+
expect(findByText("Edit")).not.toBeNull();
|
|
200
|
+
expect(findByText("Delete")).not.toBeNull();
|
|
201
201
|
});
|
|
202
202
|
|
|
203
203
|
it("renders heading and cancel options if passed in", () => {
|
|
204
204
|
const createAction = jest.fn();
|
|
205
205
|
const editAction = jest.fn();
|
|
206
|
-
const {
|
|
206
|
+
const { findByText, getByLabelText } = render(
|
|
207
207
|
<ButtonGroupForTest
|
|
208
208
|
bottomSheetHeading={"Heading"}
|
|
209
209
|
showCancelInBottomSheet={true}
|
|
@@ -223,8 +223,8 @@ it("renders heading and cancel options if passed in", () => {
|
|
|
223
223
|
|
|
224
224
|
fireEvent.press(getByLabelText("More"));
|
|
225
225
|
|
|
226
|
-
expect(
|
|
227
|
-
expect(
|
|
226
|
+
expect(findByText("Heading")).not.toBeNull();
|
|
227
|
+
expect(findByText("Cancel")).not.toBeNull();
|
|
228
228
|
});
|
|
229
229
|
|
|
230
230
|
it("renders custom button for primary action if passed in", () => {
|
|
@@ -9,7 +9,7 @@ import type { IHandles } from "react-native-modalize/lib/options";
|
|
|
9
9
|
|
|
10
10
|
type Props = React.ComponentProps<typeof Modalize>;
|
|
11
11
|
|
|
12
|
-
export const UNSAFE_WrappedModalize = forwardRef<IHandles, Props>(
|
|
12
|
+
export const UNSAFE_WrappedModalize = forwardRef<IHandles | undefined, Props>(
|
|
13
13
|
(props, ref) => {
|
|
14
14
|
const innerRef = useRef<IHandles | null>(null);
|
|
15
15
|
const [openRenderId, setOpenRenderId] = useState(0);
|
|
@@ -23,9 +23,11 @@ export const UNSAFE_WrappedModalize = forwardRef<IHandles, Props>(
|
|
|
23
23
|
requestAnimationFrame(() => {
|
|
24
24
|
innerRef.current?.open(dest);
|
|
25
25
|
});
|
|
26
|
+
props.onOpen?.();
|
|
26
27
|
},
|
|
27
28
|
close(dest) {
|
|
28
29
|
innerRef.current?.close(dest);
|
|
30
|
+
props.onClose?.();
|
|
29
31
|
},
|
|
30
32
|
}),
|
|
31
33
|
[],
|