@tecsinapse/react-native-kit 3.4.1 → 3.4.2

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.
@@ -16,6 +16,7 @@ const ModalGroupManager = ({ children, ...others }) => {
16
16
  statusBarTranslucent: true,
17
17
  animationType: "none",
18
18
  visible: hasModals,
19
+ onRequestClose: modalLifecycle.closeLastOpenedModal,
19
20
  ...others
20
21
  },
21
22
  _render
@@ -121,6 +121,11 @@ class ModalLifecycleHandler {
121
121
  savedNode && this.nodeGroup.set(id, { ...savedNode, visible: false });
122
122
  this.update();
123
123
  };
124
+ closeLastOpenedModal = () => {
125
+ const [modals] = this.state || [];
126
+ const lastModal = modals?.pop();
127
+ lastModal?.props?.close?.();
128
+ };
124
129
  }
125
130
  const createModalLifecycleHandler = () => {
126
131
  return new ModalLifecycleHandler();
@@ -14,6 +14,7 @@ const ModalGroupManager = ({ children, ...others }) => {
14
14
  statusBarTranslucent: true,
15
15
  animationType: "none",
16
16
  visible: hasModals,
17
+ onRequestClose: modalLifecycle.closeLastOpenedModal,
17
18
  ...others
18
19
  },
19
20
  _render
@@ -119,6 +119,11 @@ class ModalLifecycleHandler {
119
119
  savedNode && this.nodeGroup.set(id, { ...savedNode, visible: false });
120
120
  this.update();
121
121
  };
122
+ closeLastOpenedModal = () => {
123
+ const [modals] = this.state || [];
124
+ const lastModal = modals?.pop();
125
+ lastModal?.props?.close?.();
126
+ };
122
127
  }
123
128
  const createModalLifecycleHandler = () => {
124
129
  return new ModalLifecycleHandler();
@@ -19,6 +19,7 @@ export declare class ModalLifecycleHandler {
19
19
  private findNode;
20
20
  show: (id: string) => void;
21
21
  close: (id: string) => void;
22
+ closeLastOpenedModal: () => void;
22
23
  }
23
24
  export declare const createModalLifecycleHandler: () => ModalLifecycleHandler;
24
25
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-native-kit",
3
3
  "description": "TecSinapse React Native components",
4
- "version": "3.4.1",
4
+ "version": "3.4.2",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -39,5 +39,5 @@
39
39
  "react-native-safe-area-context": "^4.0.0",
40
40
  "react-native-vector-icons": "^9.2.0"
41
41
  },
42
- "gitHead": "c34d507099dda166804b5a2562337583dc58caaa"
42
+ "gitHead": "73cc1951c6a97b8538232602506ccfdb2623c90b"
43
43
  }