@umituz/react-native-design-system 4.28.12 → 4.28.13
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": "4.28.
|
|
3
|
+
"version": "4.28.13",
|
|
4
4
|
"description": "Universal design system for React Native apps with safe navigation hooks - updated SKILL.md with navigation documentation",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @module AtomicDatePicker
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import React, { useState } from 'react';
|
|
14
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
15
15
|
import {
|
|
16
16
|
View,
|
|
17
17
|
Platform,
|
|
@@ -82,7 +82,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
82
82
|
const tokens = useAppDesignTokens();
|
|
83
83
|
const [showPicker, setShowPicker] = useState(false);
|
|
84
84
|
|
|
85
|
-
const handleChange = (event: DateTimePickerEvent, selectedDate?: Date) => {
|
|
85
|
+
const handleChange = useCallback((event: DateTimePickerEvent, selectedDate?: Date) => {
|
|
86
86
|
if (Platform.OS === 'android') {
|
|
87
87
|
setShowPicker(false);
|
|
88
88
|
if (event.type === 'set' && selectedDate) {
|
|
@@ -96,9 +96,9 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
96
96
|
setShowPicker(false);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
};
|
|
99
|
+
}, [onChange]);
|
|
100
100
|
|
|
101
|
-
const handleOpen = () => {
|
|
101
|
+
const handleOpen = useCallback(() => {
|
|
102
102
|
if (!DateTimePicker) {
|
|
103
103
|
console.warn(
|
|
104
104
|
'[AtomicDatePicker] @react-native-community/datetimepicker is not installed. ' +
|
|
@@ -107,10 +107,10 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
setShowPicker(true);
|
|
110
|
-
};
|
|
110
|
+
}, [DateTimePicker]);
|
|
111
111
|
|
|
112
112
|
const { displayText } = useDatePickerText({ value, placeholder, mode });
|
|
113
|
-
const styles = getDatePickerStyles(tokens);
|
|
113
|
+
const styles = useMemo(() => getDatePickerStyles(tokens), [tokens]);
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
116
|
<View style={[styles.container, style]} testID={testID}>
|
|
@@ -69,11 +69,11 @@ export const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>((props,
|
|
|
69
69
|
|
|
70
70
|
const spacingMultiplier = tokens.spacingMultiplier;
|
|
71
71
|
|
|
72
|
-
const styles = useMemo(() =>
|
|
72
|
+
const styles = useMemo(() => ({
|
|
73
73
|
overlay: {
|
|
74
74
|
flex: 1,
|
|
75
75
|
backgroundColor: tokens.colors.modalOverlay,
|
|
76
|
-
justifyContent: 'flex-end',
|
|
76
|
+
justifyContent: 'flex-end' as const,
|
|
77
77
|
},
|
|
78
78
|
container: {
|
|
79
79
|
height: sheetHeight,
|
|
@@ -87,7 +87,7 @@ export const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>((props,
|
|
|
87
87
|
height: calculateResponsiveSize(BOTTOM_SHEET_HANDLE.height, spacingMultiplier),
|
|
88
88
|
backgroundColor: tokens.colors.border,
|
|
89
89
|
borderRadius: calculateResponsiveSize(BOTTOM_SHEET_HANDLE.borderRadius, spacingMultiplier),
|
|
90
|
-
alignSelf: 'center',
|
|
90
|
+
alignSelf: 'center' as const,
|
|
91
91
|
marginTop: tokens.spacing.md,
|
|
92
92
|
marginBottom: tokens.spacing.sm,
|
|
93
93
|
},
|