react-toolbox/components/card/Card.js

30 lines
683 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';
2017-01-26 20:05:32 +03:00
import { CARD } from '../identifiers';
2015-09-19 18:06:39 +03:00
2017-01-26 20:05:32 +03:00
const Card = ({ children, className, raised, theme, ...other }) => {
2016-05-20 20:53:03 +03:00
const classes = classnames(theme.card, {
2017-01-26 20:05:32 +03:00
[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 (
2017-01-26 20:05:32 +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 = {
2017-01-26 20:05:32 +03:00
children: PropTypes.node,
2015-11-22 04:43:18 +03:00
className: PropTypes.string,
2016-05-20 20:53:03 +03:00
raised: PropTypes.bool,
theme: PropTypes.shape({
card: PropTypes.string,
2017-01-26 20:05:32 +03:00
raised: PropTypes.string,
}),
2015-11-22 04:43:18 +03:00
};
2015-10-22 02:31:17 +03:00
2016-05-28 20:15:12 +03:00
export default themr(CARD)(Card);
export { Card };