All files VerticalTimeline.jsx

100% Statements 8/8
100% Branches 2/2
100% Functions 1/1
100% Lines 8/8
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          3x 3x   3x   3x 2x     3x               1x                 1x            
import React, { Component } from 'react';
import PropTypes from 'prop-types';
 
class VerticalTimeline extends Component {
  render() {
    const { animate, children } = this.props;
    let { className } = this.props;
 
    className += ' vertical-timeline';
 
    if (animate) {
      className += ' vertical-timeline--animate';
    }
 
    return (
      <div className={className.trim()}>
        {children}
      </div>
    );
  }
}
 
VerticalTimeline.propTypes = {
  children: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.node),
    PropTypes.node
  ]).isRequired,
  className: PropTypes.string,
  animate: PropTypes.bool
};
 
VerticalTimeline.defaultProps = {
  animate: true,
  className: ''
};
 
export default VerticalTimeline;