react-toolbox/components/card/Card.js

28 lines
670 B
JavaScript
Raw Normal View History

2015-11-22 04:43:18 +03:00
import React, { PropTypes } from 'react';
2016-05-20 20:53:03 +03:00
import { themr } from 'react-css-themr';
import classnames from 'classnames';
2015-09-19 18:06:39 +03:00
2016-05-20 20:53:03 +03:00
const Card = ({children, className, raised, theme, ...other}) => {
const classes = classnames(theme.card, {
[theme.raised]: raised
2015-11-22 04:43:18 +03:00
}, className);
2015-09-19 18:06:39 +03:00
2015-11-22 04:43:18 +03:00
return (
2016-02-08 21:32:37 +03:00
<div data-react-toolbox='card' className={classes} {...other}>
2015-11-22 04:43:18 +03:00
{children}
</div>
);
};
2015-11-22 04:43:18 +03:00
Card.propTypes = {
children: PropTypes.any,
className: PropTypes.string,
2016-05-20 20:53:03 +03:00
raised: PropTypes.bool,
theme: React.PropTypes.shape({
card: React.PropTypes.string.isRequired,
raised: React.PropTypes.string.isRequired
})
2015-11-22 04:43:18 +03:00
};
2015-10-22 02:31:17 +03:00
2016-05-20 20:53:03 +03:00
export default themr('ToolboxCard')(Card);