All files / components/post social-info.jsx

87.5% Statements 7/8
66.67% Branches 2/3
100% Functions 1/1
87.5% Lines 7/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          1x 1x     1x 1x       1x             1x       1x            
import React from 'react';
import PropTypes from 'prop-types';
 
class SocialInfo extends React.Component {
  render() {
    let position = '';
    switch(this.props.position) {
        case 'left':
        case 'pull-left':
            position = 'pull-left';
            break;
        default:
            position = 'pull-right';
    }
    return (
      <span className={`text-muted ${position}`}>
        {this.props.info}
      </span>
    );
  }
}
SocialInfo.propTypes = {
  info: PropTypes.string,
  position: PropTypes.string
};
SocialInfo.defaultProps = {
  info: '',
  position: 'pull-right'
};
 
export default SocialInfo;