dispatch/client/js/components/ui/Checkbox.js

19 lines
430 B
JavaScript
Raw Normal View History

2018-05-16 03:02:48 +00:00
import React from 'react';
2018-10-15 06:56:17 +00:00
import classnames from 'classnames';
2018-05-16 03:02:48 +00:00
const Checkbox = ({ name, label, topLabel, classNameLabel, ...props }) => (
2018-10-15 06:56:17 +00:00
<label
className={classnames('checkbox', classNameLabel, {
2018-10-15 06:56:17 +00:00
'top-label': topLabel
})}
htmlFor={name}
>
{topLabel && label}
<input type="checkbox" id={name} name={name} {...props} />
<span />
{!topLabel && label}
</label>
2018-05-16 03:02:48 +00:00
);
export default Checkbox;