All files / components/footer footer.jsx

100% Statements 6/6
83.33% Branches 5/6
66.67% Functions 2/3
100% Lines 6/6
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 33 34 35 36 37 38 39 40 41 42 43 44 45          2x                       1x 1x 1x                     1x             1x              
import React from 'react';
import PropTypes from 'prop-types';
 
class Footer extends React.Component {
  render() {
    return (
      <footer className='main-footer'>
        <div className="pull-right hidden-xs">
          {this.props.content}
          {this.props.content && this.props.children ? ' ' : ''}
          {this.props.children}
        </div>
        <strong>
          Copyright &copy; {this.props.copyright}&nbsp;
          <a
            href={this.props.link}
            onClick={this.props.onLinkClick ? e => {
               e.preventDefault();
               e.stopPropagation();
               this.props.onLinkClick();
             } : () => {}}
          >
            {this.props.company}
          </a>.
        </strong>
        &nbsp;<em>All rights reserved.</em>
      </footer>
    );
  }
}
Footer.propTypes = {
  content: PropTypes.string,
  copyright: PropTypes.string,
  link: PropTypes.string,
  onLinkClick: PropTypes.func,
  company: PropTypes.string
};
Footer.defaultProps = {
  content: '',
  copyright: '',
  company: ''
};
 
export default Footer;