forked from mrzachnugent/react-native-reusables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slider.tsx
30 lines (28 loc) · 848 Bytes
/
slider.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import RNCSlider from '@react-native-community/slider';
import { useTheme } from '@react-navigation/native';
import * as React from 'react';
/**
* @docs https://github.com/callstack/react-native-slider?tab=readme-ov-file#-react-native-communityslider-
*/
function Slider(props: React.ComponentProps<typeof RNCSlider>) {
const { colors } = useTheme();
const {
minimumValue = 0,
maximumValue = 1,
minimumTrackTintColor = colors.text,
maximumTrackTintColor = colors.border,
thumbTintColor = colors.text,
} = props;
return (
<RNCSlider
role='slider'
minimumValue={minimumValue}
maximumValue={maximumValue}
minimumTrackTintColor={minimumTrackTintColor}
maximumTrackTintColor={maximumTrackTintColor}
thumbTintColor={thumbTintColor}
{...props}
/>
);
}
export { Slider };