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';
|
2016-05-28 20:15:12 +03:00
|
|
|
import { CARD } from '../identifiers.js';
|
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-18 00:24:22 +03:00
|
|
|
|
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,
|
2016-06-04 00:44:33 +03:00
|
|
|
theme: PropTypes.shape({
|
|
|
|
card: PropTypes.string,
|
|
|
|
raised: PropTypes.string
|
2016-05-20 20:53:03 +03:00
|
|
|
})
|
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 };
|