cdslibrary 1.2.7 → 1.2.9
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,17 +25,19 @@ export const CDSBottomSheet = ({
|
|
|
25
25
|
onFinish,
|
|
26
26
|
}) => {
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
setChildHeight(
|
|
28
|
+
const handleLayout = (event) => {
|
|
29
|
+
const { height: layoutHeight } = event.nativeEvent.layout;
|
|
30
|
+
setChildHeight(layoutHeight);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const { theme } = useTheme();
|
|
34
|
-
|
|
34
|
+
const [childHeight, setChildHeight] = useState(0);
|
|
35
35
|
const [modalVisible, setModalVisible] = useState(isVisible);
|
|
36
36
|
const [modalOpacity] = useState(new Animated.Value(0));
|
|
37
37
|
const [slidePosition] = useState(new Animated.Value(height));
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
|
|
39
41
|
useEffect(() => {
|
|
40
42
|
const targetValue = isMobile ? height : width; // Valor fuera de pantalla
|
|
41
43
|
|
|
@@ -71,7 +73,6 @@ export const CDSBottomSheet = ({
|
|
|
71
73
|
}, isMobile ? [styles.container.typeBottomSheet, {
|
|
72
74
|
borderTopLeftRadius: theme.radius.lg,
|
|
73
75
|
borderTopRightRadius: theme.radius.lg,
|
|
74
|
-
|
|
75
76
|
}] : [styles.container.typeDrawer, {
|
|
76
77
|
borderBottomLeftRadius: theme.radius.lg, borderTopLeftRadius: theme.radius.lg, paddingBottom: theme.space.md,
|
|
77
78
|
},
|
|
@@ -87,8 +88,8 @@ export const CDSBottomSheet = ({
|
|
|
87
88
|
style={{ position: "absolute", right: theme.space.sm, top: theme.space.sm }}
|
|
88
89
|
/>
|
|
89
90
|
)}
|
|
90
|
-
|
|
91
|
-
<View style={styles.scrollWrapper}>
|
|
91
|
+
<Text style={theme.typography.bold.lg}>{title}</Text>
|
|
92
|
+
<View style={styles.scrollWrapper}>
|
|
92
93
|
<ScrollView
|
|
93
94
|
style={styles.scrollArea}
|
|
94
95
|
contentContainerStyle={[styles.scrollContent, {
|
|
@@ -104,12 +105,10 @@ export const CDSBottomSheet = ({
|
|
|
104
105
|
)}
|
|
105
106
|
{customSlot && <View style={styles.customSlot}>{customSlot}</View>}
|
|
106
107
|
</ScrollView>
|
|
107
|
-
|
|
108
|
-
{/* El Gradiente */}
|
|
109
108
|
<LinearGradient
|
|
110
|
-
colors={['transparent', theme.surface.neutral.primary]}
|
|
109
|
+
colors={['transparent', theme.surface.neutral.primary]}
|
|
111
110
|
style={styles.fadeGradient}
|
|
112
|
-
pointerEvents="none"
|
|
111
|
+
pointerEvents="none"
|
|
113
112
|
/>
|
|
114
113
|
</View>
|
|
115
114
|
{type !== "informative" && (
|
|
@@ -182,10 +181,10 @@ const styles = StyleSheet.create({
|
|
|
182
181
|
width: '100%',
|
|
183
182
|
},
|
|
184
183
|
scrollArea: {
|
|
185
|
-
flexShrink: 1,
|
|
184
|
+
flexShrink: 1,
|
|
186
185
|
flexGrow: 1,
|
|
187
|
-
width: '100%',
|
|
188
|
-
paddingBottom: 20,
|
|
186
|
+
width: '100%',
|
|
187
|
+
paddingBottom: 20,
|
|
189
188
|
},
|
|
190
189
|
|
|
191
190
|
scrollContent: {
|
|
@@ -25,7 +25,7 @@ export const CDSButtonGroup = ({ options, onSelect, label='Label' }) => {
|
|
|
25
25
|
// Si está seleccionado es 'primary', si no 'secondary'
|
|
26
26
|
type={selectedIndex === index ? "primary" : "secondary"}
|
|
27
27
|
isActive={selectedIndex === index}
|
|
28
|
-
onPress={() => handlePress(index, option.
|
|
28
|
+
onPress={() => handlePress(index, option.value)}
|
|
29
29
|
/>
|
|
30
30
|
|
|
31
31
|
))}
|