@umituz/react-native-design-system 2.6.43 → 2.6.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "2.6.43",
3
+ "version": "2.6.44",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -79,14 +79,41 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
79
79
 
80
80
  useImperativeHandle(ref, () => ({
81
81
  present: () => {
82
- if (__DEV__) console.log('[BottomSheetModal] present() called', { refExists: !!modalRef.current });
83
- modalRef.current?.present();
82
+ if (__DEV__) {
83
+ console.log('[BottomSheetModal] present() called', {
84
+ refExists: !!modalRef.current,
85
+ hasPresentMethod: typeof modalRef.current?.present === 'function',
86
+ refType: typeof modalRef.current,
87
+ refKeys: modalRef.current ? Object.keys(modalRef.current) : []
88
+ });
89
+ }
90
+
91
+ try {
92
+ if (!modalRef.current) {
93
+ if (__DEV__) console.error('[BottomSheetModal] modalRef.current is null!');
94
+ return;
95
+ }
96
+
97
+ if (typeof modalRef.current.present !== 'function') {
98
+ if (__DEV__) console.error('[BottomSheetModal] present is not a function!', typeof modalRef.current.present);
99
+ return;
100
+ }
101
+
102
+ if (__DEV__) console.log('[BottomSheetModal] Calling modalRef.current.present()...');
103
+ modalRef.current.present();
104
+ if (__DEV__) console.log('[BottomSheetModal] modalRef.current.present() executed');
105
+ } catch (error) {
106
+ if (__DEV__) console.error('[BottomSheetModal] Error calling present():', error);
107
+ }
84
108
  },
85
109
  dismiss: () => {
86
110
  if (__DEV__) console.log('[BottomSheetModal] dismiss() called');
87
111
  modalRef.current?.dismiss();
88
112
  },
89
- snapToIndex: (index: number) => modalRef.current?.snapToIndex(index),
113
+ snapToIndex: (index: number) => {
114
+ if (__DEV__) console.log('[BottomSheetModal] snapToIndex called', { index });
115
+ modalRef.current?.snapToIndex(index);
116
+ },
90
117
  snapToPosition: (pos: string | number) => modalRef.current?.snapToPosition(pos),
91
118
  expand: () => modalRef.current?.expand(),
92
119
  collapse: () => modalRef.current?.collapse(),
@@ -5,7 +5,17 @@ interface SafeBottomSheetModalProviderProps {
5
5
  children: ReactNode;
6
6
  }
7
7
 
8
- export const SafeBottomSheetModalProvider = ({ children }: SafeBottomSheetModalProviderProps) => (
9
- <BottomSheetModalProvider>{children}</BottomSheetModalProvider>
10
- );
8
+ export const SafeBottomSheetModalProvider = ({ children }: SafeBottomSheetModalProviderProps) => {
9
+ React.useEffect(() => {
10
+ if (__DEV__) {
11
+ console.log('[SafeBottomSheetModalProvider] Mounted and providing context');
12
+ }
13
+ }, []);
14
+
15
+ if (__DEV__) {
16
+ console.log('[SafeBottomSheetModalProvider] Rendering');
17
+ }
18
+
19
+ return <BottomSheetModalProvider>{children}</BottomSheetModalProvider>;
20
+ };
11
21