Skip to content

Commit 9f0a3cf

Browse files
committed
fix: allow wheelpicker to change tint for fader
1 parent 55acba9 commit 9f0a3cf

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/components/sectionsWheelPicker/sectionsWheelPicker.api.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
{"name": "inactiveTextColor", "type": "string", "description": "Text color for other, non-focused rows"},
2525
{"name": "textStyle", "type": "TextStyle", "description": "Row text style"},
2626
{"name": "xxx", "type": "xxxx", "description": "xxxxx"},
27-
{"name": "testID", "type": "string", "description": "The component test id"}
27+
{"name": "testID", "type": "string", "description": "The component test id"},
28+
{"name": "tintColor", "type": "string", "description": "The tint color of the fade view."}
2829
],
29-
"snippet": [
30-
"<SectionsWheelPicker sections={$1}/>"
31-
]
30+
"snippet": ["<SectionsWheelPicker sections={$1}/>"]
3231
}

src/incubator/WheelPicker/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export interface WheelPickerProps {
7878
*/
7979
separatorsStyle?: ViewStyle;
8080
testID?: string;
81+
/**
82+
* Change the default (white) tint color of the fade view.
83+
*/
84+
tintColor?: string;
8185
}
8286

8387
const WheelPicker = ({
@@ -96,7 +100,8 @@ const WheelPicker = ({
96100
children,
97101
initialValue = 0,
98102
separatorsStyle,
99-
testID
103+
testID,
104+
tintColor
100105
}: WheelPickerProps) => {
101106
const scrollView = useRef<Animated.ScrollView>();
102107
const offset = useSharedValue(0);
@@ -242,7 +247,7 @@ const WheelPicker = ({
242247
}, [flatListWidth, labelContainerStyle, label, labelProps, activeTextColor, labelStyle]);
243248

244249
const fader = useMemo(() => (position: FaderPosition) => {
245-
return <Fader visible position={position} size={60}/>;
250+
return <Fader tintColor={tintColor} visible position={position} size={60}/>;
246251
},
247252
[]);
248253

0 commit comments

Comments
 (0)