import React from 'react'; import { Platform, requireNativeComponent } from 'react-native'; import { RangeSliderProps, RangeSliderChangeEvent } from './types'; const Slider = requireNativeComponent('RNRangeSlider'); const RangeSlider: React.FC = ({ min, max, onChange, tintColor, tintColorBetweenHandles, step, handleBorderColor, handleColor, handleDiameter, handleBorderWidth, type = 'range', selectedMaximum, selectedMinimum, minLabelColor, maxLabelColor, lineHeight, prefix, suffix, hideLabels, maxLabelFont, minLabelFont, maxLabelFontSize, minLabelFontSize, lineBorderWidth, lineBorderColor, labelPadding, minDistance, maxDistance, leftHandleColor, rightHandleColor, leftHandlePressedColor, rightHandlePressedColor, handlePressedColor, minStartValue, maxStartValue, fixGap, style = {}, cornerRadius, }: RangeSliderProps) => { const defaultStyle = { width: '100%', height: 70, }; const handleChange = ({ nativeEvent }: RangeSliderChangeEvent) => { onChange && onChange(nativeEvent.min, nativeEvent.max); }; if (Platform.OS === 'android') { return ( ); } else { return ( ); } }; RangeSlider.defaultProps = { min: 0, max: 100, step: 1, type: 'range', selectedMinimum: 0, selectedMaximum: 100, tintColor: '#DCDCDC', // extra light gray }; export default RangeSlider;