Skip to content

Feat/ support separatorsStyle in WheelPicker #1906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion generatedTypes/src/incubator/WheelPicker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ export interface WheelPickerProps {
* Align the content to center, right ot left (default: center)
*/
align?: WheelPickerAlign;
/**
* Extra style for the separators
*/
separatorsStyle?: ViewStyle;
testID?: string;
}
declare const _default: React.ComponentClass<WheelPickerProps & {
useCustomTheme?: boolean | undefined;
}, any> & {
({ items: propItems, itemHeight, numberOfVisibleRows, activeTextColor, inactiveTextColor, textStyle, label, labelStyle, labelProps, onChange, align, style, children, initialValue, testID }: WheelPickerProps): JSX.Element;
({ items: propItems, itemHeight, numberOfVisibleRows, activeTextColor, inactiveTextColor, textStyle, label, labelStyle, labelProps, onChange, align, style, children, initialValue, separatorsStyle, testID }: WheelPickerProps): JSX.Element;
alignments: typeof WheelPickerAlign;
displayName: string;
};
Expand Down
7 changes: 6 additions & 1 deletion src/incubator/WheelPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export interface WheelPickerProps {
* Align the content to center, right ot left (default: center)
*/
align?: WheelPickerAlign;
/**
* Extra style for the separators
*/
separatorsStyle?: ViewStyle;
testID?: string;
}

Expand All @@ -91,6 +95,7 @@ const WheelPicker = ({
style,
children,
initialValue = 0,
separatorsStyle,
testID
}: WheelPickerProps) => {
const scrollView = useRef<Animated.ScrollView>();
Expand Down Expand Up @@ -244,7 +249,7 @@ const WheelPicker = ({
const separators = useMemo(() => {
return (
<View absF centerV pointerEvents="none">
<View style={styles.separators}/>
<View style={[styles.separators, separatorsStyle]}/>
</View>
);
}, []);
Expand Down
3 changes: 2 additions & 1 deletion src/incubator/WheelPicker/wheelPicker.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"description": "Align the content to center, right ot left",
"default": "center"
},
{"name": "testID", "type": "string", "description": "Align the content to center, right ot left"}
{"name": "separatorsStyle", "type": "ViewStyle", "description": "Extra style for the separators"},
{"name": "testID", "type": "string", "description": "test identifier"}
],
"snippet": [
"<WheelPicker",
Expand Down