| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | import PropTypes from 'prop-types'; |
| 3 | 3 | // Import styles |
| 4 | 4 | import styles from './style.module.scss'; |
| 5 | 5 | |
| 6 | -const Card = ({width, title, children}) => { | |
| 6 | +const Card = ({width = 4, title = null, children = null}) => { | |
| 7 | 7 | return ( |
| 8 | 8 | <div className={styles.card} style={{gridColumn: 'span ' + width}}> |
| 9 | 9 | {title && <div className={styles.title}>{title}</div>} |
| 10 | 10 | <div className={styles.content}>{children}</div> |
| @@ -18,13 +18,7 @@ | ||
| 18 | 18 | // Title of card |
| 19 | 19 | title: PropTypes.string, |
| 20 | 20 | // Elements to displayed in content area of card (eg: Chart, List) |
| 21 | 21 | children: PropTypes.node.isRequired, |
| 22 | -}; | |
| 23 | - | |
| 24 | -Card.defaultProps = { | |
| 25 | - width: 4, | |
| 26 | - title: null, | |
| 27 | - children: null, | |
| 28 | 22 | }; |
| 29 | 23 | |
| 30 | 24 | export default Card; |