react-toolbox/components/radio/Radio.js

28 lines
612 B
JavaScript
Raw Normal View History

2016-04-09 21:34:34 +03:00
import React, { PropTypes } from 'react';
2015-12-07 03:40:59 +03:00
2016-05-29 23:09:02 +03:00
const factory = (ripple) => {
2017-01-26 20:05:32 +03:00
const Radio = ({ checked, onMouseDown, theme, ...other }) => (
2016-05-29 23:09:02 +03:00
<div
2017-01-26 20:05:32 +03:00
data-react-toolbox="radio"
2016-05-29 23:09:02 +03:00
className={theme[checked ? 'radioChecked' : 'radio']}
onMouseDown={onMouseDown}
{...other}
/>
);
2015-12-07 03:40:59 +03:00
2016-05-29 23:09:02 +03:00
Radio.propTypes = {
checked: PropTypes.bool,
2017-01-26 20:05:32 +03:00
children: PropTypes.node,
2016-05-29 23:09:02 +03:00
onMouseDown: PropTypes.func,
theme: PropTypes.shape({
radio: PropTypes.string,
radioChecked: PropTypes.string,
2017-01-26 20:05:32 +03:00
ripple: PropTypes.string,
}),
2016-05-29 23:09:02 +03:00
};
return ripple(Radio);
2016-04-09 21:34:34 +03:00
};
2016-05-29 23:09:02 +03:00
export default factory;