@umituz/react-native-design-system 2.6.42 → 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.
|
|
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",
|
|
@@ -68,6 +68,9 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
|
|
|
68
68
|
|
|
69
69
|
const handleSheetChange = useCallback(
|
|
70
70
|
(index: number) => {
|
|
71
|
+
if (__DEV__) {
|
|
72
|
+
console.log('[BottomSheetModal] onChange triggered', { index });
|
|
73
|
+
}
|
|
71
74
|
onChange?.(index);
|
|
72
75
|
if (index === -1) onDismiss?.();
|
|
73
76
|
},
|
|
@@ -76,14 +79,41 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
|
|
|
76
79
|
|
|
77
80
|
useImperativeHandle(ref, () => ({
|
|
78
81
|
present: () => {
|
|
79
|
-
if (__DEV__)
|
|
80
|
-
|
|
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
|
+
}
|
|
81
108
|
},
|
|
82
109
|
dismiss: () => {
|
|
83
110
|
if (__DEV__) console.log('[BottomSheetModal] dismiss() called');
|
|
84
111
|
modalRef.current?.dismiss();
|
|
85
112
|
},
|
|
86
|
-
snapToIndex: (index: number) =>
|
|
113
|
+
snapToIndex: (index: number) => {
|
|
114
|
+
if (__DEV__) console.log('[BottomSheetModal] snapToIndex called', { index });
|
|
115
|
+
modalRef.current?.snapToIndex(index);
|
|
116
|
+
},
|
|
87
117
|
snapToPosition: (pos: string | number) => modalRef.current?.snapToPosition(pos),
|
|
88
118
|
expand: () => modalRef.current?.expand(),
|
|
89
119
|
collapse: () => modalRef.current?.collapse(),
|
|
@@ -99,6 +129,14 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
|
|
|
99
129
|
}
|
|
100
130
|
}, []);
|
|
101
131
|
|
|
132
|
+
React.useEffect(() => {
|
|
133
|
+
if (__DEV__) {
|
|
134
|
+
console.log('[BottomSheetModal] modalRef updated', {
|
|
135
|
+
hasModalRef: !!modalRef.current,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}, [modalRef.current]);
|
|
139
|
+
|
|
102
140
|
return (
|
|
103
141
|
<GorhomBottomSheetModal
|
|
104
142
|
ref={modalRef}
|
|
@@ -111,6 +149,11 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
|
|
|
111
149
|
enablePanDownToClose={config.enablePanDownToClose}
|
|
112
150
|
onChange={handleSheetChange}
|
|
113
151
|
onDismiss={onDismiss}
|
|
152
|
+
onAnimate={(fromIndex, toIndex) => {
|
|
153
|
+
if (__DEV__) {
|
|
154
|
+
console.log('[BottomSheetModal] onAnimate', { fromIndex, toIndex });
|
|
155
|
+
}
|
|
156
|
+
}}
|
|
114
157
|
backgroundStyle={[styles.background, { backgroundColor: backgroundColor || tokens.colors.surface }]}
|
|
115
158
|
handleIndicatorStyle={[styles.handleIndicator, { backgroundColor: tokens.colors.border }]}
|
|
116
159
|
>
|
|
@@ -5,7 +5,17 @@ interface SafeBottomSheetModalProviderProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const SafeBottomSheetModalProvider = ({ children }: SafeBottomSheetModalProviderProps) =>
|
|
9
|
-
|
|
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
|
|