UNPKG

@material-ui/core

Version:

React components that implement Google's Material Design.

53 lines (48 loc) 1.48 kB
import _extends from "@babel/runtime/helpers/builtin/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/builtin/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import withStyles from '../styles/withStyles'; export const styles = theme => ({ root: theme.mixins.gutters({ paddingTop: theme.spacing.unit * 2, paddingBottom: theme.spacing.unit * 2, '&:last-child': { paddingBottom: theme.spacing.unit * 3 } }) }); function CardContent(props) { const { classes, className, component: Component } = props, other = _objectWithoutProperties(props, ["classes", "className", "component"]); return React.createElement(Component, _extends({ className: classNames(classes.root, className) }, other)); } CardContent.propTypes = process.env.NODE_ENV !== "production" ? { /** * Override or extend the styles applied to the component. * See [CSS API](#css-api) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]) } : {}; CardContent.defaultProps = { component: 'div' }; export default withStyles(styles, { name: 'MuiCardContent' })(CardContent);