dhre-ui-kit 0.0.34 → 0.0.36
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
|
@@ -23,6 +23,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
|
|
|
23
23
|
rightIcon = <CrossIcon />,
|
|
24
24
|
onLeftIconPress,
|
|
25
25
|
titleStyle,
|
|
26
|
+
titleVariant = 'B2_REGULAR',
|
|
26
27
|
}) => {
|
|
27
28
|
return (
|
|
28
29
|
<Modal
|
|
@@ -47,9 +48,9 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
|
|
|
47
48
|
onPress: onLeftIconPress,
|
|
48
49
|
})}
|
|
49
50
|
<CustomTypography
|
|
50
|
-
variant=
|
|
51
|
+
variant={titleVariant}
|
|
51
52
|
text={title}
|
|
52
|
-
style={
|
|
53
|
+
style={{...styles.title, ...titleStyle}}
|
|
53
54
|
/>
|
|
54
55
|
{showRightIcon &&
|
|
55
56
|
React.cloneElement(rightIcon, {
|
|
@@ -3,8 +3,8 @@ import {ScrollView, Pressable, View, StyleSheet} from 'react-native';
|
|
|
3
3
|
import CustomText from '../customText/CustomText';
|
|
4
4
|
|
|
5
5
|
interface ScrollableListProps {
|
|
6
|
-
data: string[];
|
|
7
|
-
handleSelectCategory: (
|
|
6
|
+
data: {name: string; value: string}[];
|
|
7
|
+
handleSelectCategory: (value: string) => void;
|
|
8
8
|
containerStyle?: object;
|
|
9
9
|
scrollViewContentStyle?: object;
|
|
10
10
|
itemStyle?: object;
|
|
@@ -23,7 +23,9 @@ const ScrollableList = ({
|
|
|
23
23
|
selectedItemTextColor = 'CONTENT_PRIMARY',
|
|
24
24
|
defaultItemTextColor = 'CONTENT_SECONDRY',
|
|
25
25
|
}: ScrollableListProps) => {
|
|
26
|
-
const [selectedItem, setSelectedItem] = useState<string | null>(
|
|
26
|
+
const [selectedItem, setSelectedItem] = useState<string | null>(
|
|
27
|
+
data.length > 0 ? data[0].name : null,
|
|
28
|
+
);
|
|
27
29
|
|
|
28
30
|
return (
|
|
29
31
|
<View style={[styles.container, containerStyle]}>
|
|
@@ -36,21 +38,24 @@ const ScrollableList = ({
|
|
|
36
38
|
]}>
|
|
37
39
|
{data?.map(item => (
|
|
38
40
|
<Pressable
|
|
39
|
-
key={item}
|
|
41
|
+
key={item.value} // Use item.value as the key
|
|
40
42
|
style={[
|
|
41
43
|
styles.item,
|
|
42
44
|
itemStyle,
|
|
43
|
-
selectedItem === item && [
|
|
45
|
+
selectedItem === item.name && [
|
|
46
|
+
styles.selectedItem,
|
|
47
|
+
selectedItemStyle,
|
|
48
|
+
],
|
|
44
49
|
]}
|
|
45
50
|
onPress={() => {
|
|
46
|
-
setSelectedItem(item);
|
|
47
|
-
handleSelectCategory(item);
|
|
51
|
+
setSelectedItem(item.name);
|
|
52
|
+
handleSelectCategory(item.name);
|
|
48
53
|
}}>
|
|
49
54
|
<CustomText
|
|
50
|
-
text={item}
|
|
55
|
+
text={item.name}
|
|
51
56
|
variant="L1_REGULAR"
|
|
52
57
|
textColor={
|
|
53
|
-
selectedItem === item
|
|
58
|
+
selectedItem === item.name
|
|
54
59
|
? selectedItemTextColor
|
|
55
60
|
: defaultItemTextColor
|
|
56
61
|
}
|