cdslibrary 1.2.9 → 1.2.10
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/components/CDSBottomSheet.jsx +17 -11
- package/package.json +1 -1
|
@@ -25,9 +25,9 @@ export const CDSBottomSheet = ({
|
|
|
25
25
|
onFinish,
|
|
26
26
|
}) => {
|
|
27
27
|
|
|
28
|
-
const handleLayout = (event) => {
|
|
28
|
+
const handleLayout = (event) => {
|
|
29
29
|
const { height: layoutHeight } = event.nativeEvent.layout;
|
|
30
|
-
setChildHeight(layoutHeight);
|
|
30
|
+
setChildHeight(layoutHeight);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const { theme } = useTheme();
|
|
@@ -37,7 +37,7 @@ const handleLayout = (event) => {
|
|
|
37
37
|
const [slidePosition] = useState(new Animated.Value(height));
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
const targetValue = isMobile ? height : width; // Valor fuera de pantalla
|
|
43
43
|
|
|
@@ -84,7 +84,10 @@ const handleLayout = (event) => {
|
|
|
84
84
|
name={"close"}
|
|
85
85
|
size={theme.typography.icon.lg}
|
|
86
86
|
color={theme.text.neutral.primary}
|
|
87
|
-
onPress={() =>
|
|
87
|
+
onPress={() => {
|
|
88
|
+
onFinish();
|
|
89
|
+
setModalVisible(false);
|
|
90
|
+
}}
|
|
88
91
|
style={{ position: "absolute", right: theme.space.sm, top: theme.space.sm }}
|
|
89
92
|
/>
|
|
90
93
|
)}
|
|
@@ -106,25 +109,28 @@ const handleLayout = (event) => {
|
|
|
106
109
|
{customSlot && <View style={styles.customSlot}>{customSlot}</View>}
|
|
107
110
|
</ScrollView>
|
|
108
111
|
<LinearGradient
|
|
109
|
-
colors={['transparent', theme.surface.neutral.primary]}
|
|
112
|
+
colors={['transparent', theme.surface.neutral.primary]}
|
|
110
113
|
style={styles.fadeGradient}
|
|
111
|
-
pointerEvents="none"
|
|
114
|
+
pointerEvents="none"
|
|
112
115
|
/>
|
|
113
116
|
</View>
|
|
114
117
|
{type !== "informative" && (
|
|
115
118
|
<View style={isMobile ? styles.actionsContainer.typeBottomSheet : styles.actionsContainer.typeDrawer}>
|
|
116
119
|
<CDSButton
|
|
117
120
|
label={primaryButtonLabel}
|
|
118
|
-
onPress={
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
onPress={() => {
|
|
122
|
+
primaryButtonOnPress(),
|
|
123
|
+
setModalVisible(!modalVisible)
|
|
124
|
+
}
|
|
122
125
|
}
|
|
123
126
|
/>
|
|
124
127
|
<CDSButton
|
|
125
128
|
label={secondaryButtonLabel}
|
|
126
129
|
type="ghost"
|
|
127
|
-
onPress={() =>
|
|
130
|
+
onPress={() => {
|
|
131
|
+
onFinish();
|
|
132
|
+
setModalVisible(false);
|
|
133
|
+
}}
|
|
128
134
|
/>
|
|
129
135
|
</View>
|
|
130
136
|
)}
|