cdslibrary 1.2.10 → 1.2.11

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.
@@ -25,22 +25,23 @@ export const CDSBottomSheet = ({
25
25
  onFinish,
26
26
  }) => {
27
27
 
28
- const handleLayout = (event) => {
29
- const { height: layoutHeight } = event.nativeEvent.layout;
30
- setChildHeight(layoutHeight);
31
- };
32
-
28
+
29
+
33
30
  const { theme } = useTheme();
34
31
  const [childHeight, setChildHeight] = useState(0);
35
32
  const [modalVisible, setModalVisible] = useState(isVisible);
36
33
  const [modalOpacity] = useState(new Animated.Value(0));
37
34
  const [slidePosition] = useState(new Animated.Value(height));
38
-
39
-
35
+
36
+ const handleLayout = (event) => {
37
+ const { height: layoutHeight } = event.nativeEvent.layout;
38
+ setChildHeight(layoutHeight);
39
+ };
40
40
 
41
41
  useEffect(() => {
42
42
  const targetValue = isMobile ? height : width; // Valor fuera de pantalla
43
43
 
44
+
44
45
  Animated.parallel([
45
46
  Animated.timing(modalOpacity, {
46
47
  toValue: modalVisible ? 1 : 0,
@@ -85,7 +86,7 @@ export const CDSBottomSheet = ({
85
86
  size={theme.typography.icon.lg}
86
87
  color={theme.text.neutral.primary}
87
88
  onPress={() => {
88
- onFinish();
89
+ onFinish && onFinish();
89
90
  setModalVisible(false);
90
91
  }}
91
92
  style={{ position: "absolute", right: theme.space.sm, top: theme.space.sm }}
@@ -119,8 +120,8 @@ export const CDSBottomSheet = ({
119
120
  <CDSButton
120
121
  label={primaryButtonLabel}
121
122
  onPress={() => {
122
- primaryButtonOnPress(),
123
- setModalVisible(!modalVisible)
123
+ primaryButtonOnPress && primaryButtonOnPress();
124
+ setModalVisible(false)
124
125
  }
125
126
  }
126
127
  />
@@ -128,7 +129,7 @@ export const CDSBottomSheet = ({
128
129
  label={secondaryButtonLabel}
129
130
  type="ghost"
130
131
  onPress={() => {
131
- onFinish();
132
+ onFinish && onFinish();
132
133
  setModalVisible(false);
133
134
  }}
134
135
  />
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.10",
4
+ "version": "1.2.11",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",