react-toolbox/components/switch/Thumb.js

21 lines
452 B
JavaScript
Raw Normal View History

2016-04-09 21:34:34 +03:00
import React, { PropTypes } from 'react';
2015-12-07 04:14:10 +03:00
const factory = (ripple) => {
2017-01-26 20:05:32 +03:00
const Thumb = ({ onMouseDown, theme, ...other }) => (
<span className={theme.thumb} onMouseDown={onMouseDown} {...other} />
);
2015-12-07 04:14:10 +03:00
Thumb.propTypes = {
2017-01-26 20:05:32 +03:00
children: PropTypes.node,
onMouseDown: PropTypes.func,
theme: PropTypes.shape({
ripple: PropTypes.string,
2017-01-26 20:05:32 +03:00
thumb: PropTypes.string,
}),
};
return ripple(Thumb);
2016-04-09 21:34:34 +03:00
};
export default factory;