All files / src/components/PageCard component.jsx

100% Statements 4/4
50% Branches 2/4
100% Functions 1/1
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32                        2x 3x   3x                 2x              
import styles from './style.postcss';
 
import React from 'react';
import pure from 'recompose/pure';
import classnames from 'classnames';
import is from 'is_js';
import PropTypes from 'prop-types';
 
import Card from 'components/Card';
 
import Heading from './Heading';
 
const PageCard = (props) => {
  const { className, headingText } = props;
 
  return <Card borderless
      className={classnames(styles.PageCard, className)}>
    {is.string(headingText) && headingText.length ?
      <Heading text={headingText} /> :
      null}
    {props.children}
  </Card>;
};
 
PageCard.propTypes = {
  headingText: PropTypes.string,
  children: PropTypes.node,
  className: PropTypes.string,
};
 
export default pure(PageCard);