1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import React from 'react'
- import PropTypes from 'prop-types'
- import classnames from 'classnames'
- import CardHeader from './CardHeader.jsx'
- import CardBody from './CardBody.jsx'
-
- const Card = props => {
- return (
- <div className={classnames(props.customClass, 'card')}>
- {props.children}
- </div>
- )
- }
- export default Card
-
- Card.propTypes = {
-
-
-
-
-
-
-
-
- children: PropTypes.arrayOf((children, key, componentName /* , location, propFullName */) => {
- if (
- children.length > 2 ||
- children[0].type !== CardHeader ||
- children[1].type !== CardBody
-
- ) {
- return new Error(`PropType Error: childrens of ${componentName} must be: 1 CardHeader and 1 CardBody.`)
- }
- }).isRequired,
- customClass: PropTypes.string
- }
-
- Card.defaultProps = {
- customClass: ''
- }
|