@react-native-segmented-control/segmented-control 2.5.1 → 2.5.3
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/js/SegmentedControl.js +14 -14
- package/package.json +2 -2
package/js/SegmentedControl.js
CHANGED
|
@@ -93,6 +93,20 @@ const SegmentedControl = ({
|
|
|
93
93
|
selectedIndex={selectedIndex}
|
|
94
94
|
/>
|
|
95
95
|
)}
|
|
96
|
+
{selectedIndex != null && segmentWidth ? (
|
|
97
|
+
<Animated.View
|
|
98
|
+
style={[
|
|
99
|
+
styles.slider,
|
|
100
|
+
{
|
|
101
|
+
transform: [{translateX: animation}],
|
|
102
|
+
width: segmentWidth - 4,
|
|
103
|
+
zIndex: -1,
|
|
104
|
+
backgroundColor:
|
|
105
|
+
tintColor || (colorScheme === 'dark' ? '#636366' : 'white'),
|
|
106
|
+
},
|
|
107
|
+
]}
|
|
108
|
+
/>
|
|
109
|
+
) : null}
|
|
96
110
|
<View style={styles.segmentsContainer}>
|
|
97
111
|
{values &&
|
|
98
112
|
values.map((value, index) => {
|
|
@@ -117,20 +131,6 @@ const SegmentedControl = ({
|
|
|
117
131
|
);
|
|
118
132
|
})}
|
|
119
133
|
</View>
|
|
120
|
-
{selectedIndex != null && segmentWidth ? (
|
|
121
|
-
<Animated.View
|
|
122
|
-
style={[
|
|
123
|
-
styles.slider,
|
|
124
|
-
{
|
|
125
|
-
transform: [{translateX: animation}],
|
|
126
|
-
width: segmentWidth - 4,
|
|
127
|
-
zIndex: -1,
|
|
128
|
-
backgroundColor:
|
|
129
|
-
tintColor || (colorScheme === 'dark' ? '#636366' : 'white'),
|
|
130
|
-
},
|
|
131
|
-
]}
|
|
132
|
-
/>
|
|
133
|
-
) : null}
|
|
134
134
|
</View>
|
|
135
135
|
);
|
|
136
136
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-segmented-control/segmented-control",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "React Native SegmentedControlIOS library",
|
|
5
5
|
"main": "js/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"flow-bin": "^0.142.0",
|
|
44
44
|
"husky": "^8.0.1",
|
|
45
45
|
"jest": "^29.2.1",
|
|
46
|
-
"metro-react-native-babel-preset": "0.
|
|
46
|
+
"metro-react-native-babel-preset": "0.77.0",
|
|
47
47
|
"react": "17.0.2",
|
|
48
48
|
"react-dom": "17.0.2",
|
|
49
49
|
"react-native": "0.63.4",
|