/* eslint-disable react/jsx-indent-props */ /* eslint-disable import/no-absolute-path */ import React from 'react'; import PropTypes from 'prop-types'; import { Trans, withTranslation } from 'react-i18next'; import Tooltip from 'rc-tooltip'; import Slider from 'rc-slider'; import 'rc-slider/assets/index.css'; import './DistanceSlider.scss'; // https://www.npmjs.com/package/rc-slider const createSliderWithTooltip = Slider.createSliderWithTooltip; const Handle = Slider.Handle; const handle = (props) => { const { value, dragging, index, ...restProps } = props; return ( ); }; // https://github.com/react-component/slider/tree/master/examples class DistanceSlider extends React.Component { constructor(props) { super(props); this.state = { value: 10 }; this.onSliderChange = this.onSliderChange.bind(this); this.onAfterChange = this.onAfterChange.bind(this); this.props.onChange(10); } onSliderChange(value) { // console.log(value); this.setState({ value }); this.props.onChange(value); } onAfterChange(value) { // console.log(`After change: ${value}`); //eslint-disable-line this.props.onChange(value); } render() { return (

¿A que distancia a la redonda quieres recibir notificaciones de fuegos?

); } } DistanceSlider.defaultProps = { onChange: null }; DistanceSlider.propTypes = { onChange: PropTypes.func }; export default withTranslation()(DistanceSlider);